Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
[Ubuntu] How to view command-line output from an SSH window of a previously launched CLI program?
Author Summary
nerdyguy76 is in Ubuntu
Post Body

Hello,

I'm actually pretty savvy with computers but this is one question I couldn't find an answer to online. Everything I searched lead me to different answers.

If I have a shell program on my Linux server that starts up automatically when the computer turns on, is there a way for me to log into an SSH terminal and bring that process's stout into my SSH's view? Like, I want to make any of the output that would normally be visible on the shell window running that program to be viewable on the SSH window. Maybe even show me previously output messages?

I'm running a game server and would like to monitor warnings, know when people log on, etc. without having to actually go to the computer since it's pretty much a headless unit.

​

Update: The answer that I settled on was installing screen from apt-get. Then I made two script files:

run.sh

#!/bin/sh
screen -d -m -S mc1 /home/<logon name>/Desktop/run2.sh

​

run2.sh

#!/bin/sh
BINDIR=$(dirname "$(readlink -fn "$0")")
cd "$BINDIR"
​
java -Xms1024M -Xmx1536M -jar server1_13_1.jar -o true nogui

​

I made the run.sh a startup application in Ubuntu and it works great. I can ssh into the server using putty and then use the command `screen -r` to view the output as well as send shutdown commands, for example.

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
14,472
Link Karma
2,729
Comment Karma
11,717
Profile updated: 4 days ago
Posts updated: 11 months ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago