I have a bunch of servers, on which I run experiments using screen
. The procedure is the following :
ssh
to server XXX- launch
screen
- start experiments in a few tabs
- detach
screen
- disconnect from the server
While the experiments are running, I can easily find on which servers they are by ssh
ing to all servers and listing my running processes (using top
or ps
).
However, once the experiments are finished, how could I find on which servers I have a screen session opened (so that I can have a look at the output, relaunch them, etc.) ?
PS: my experiments do print their output to files, too... but this is not the point of my question.
In most cases a
screen -RRx $username/
will suffice :)If you still want to list all screens then put the following script in your path and call it screen or whatever you like:
It will behave exactly like screen except for showing all screen sessions, when giving the option -ls-all as first parameter.
If you want to see screen in Console then you have to write command
if you have to access the screen then you have to use below command
Write
PWD
in command line to check at which folder you are currentlyMultiple folks have already pointed that
would list the screen sessions.
Here is another trick that may be useful to you.
If you add the following command as a last line in your .bashrc file on server xxx, then it will automatically reconnect to your screen session on login.
Hope you find it useful.