[Linux] Screen

Hello there, this a 5 Minute Tutorial to screen.
What Screen is?
Well screen is an old unix / linux terminal programm with which you can create multiple virtual "screens".
You can switch between these screens and also can disconnect from them.
Especially useful: If you start an daemon within screen and disconnect from it,
you can reconnect anytime and see what its doing.
Or you can setup a screen session, detach and close your SSH.
If you reconnect, it will still be running.
Oh, and it will be also there and running if your connection drops.

My little list of important Screen Commands:

screen // Create a Screen
screen -ls // List active Screen sessions
screen -r // Resume Screen, if multiple, enter Screen Number from ls after r

CTRL A C - create new tab
CTRL A P - previous
CTRL A N - next
CTRL A D - detach from Screen

To close and exit a screen, just type exit within the screen session.
To start an script in the same folder "daemon like": screen -A -m -d -S SCREENSESSIONNAME ./SCRIPTNAME.sh

Easy, ain't it?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.