Skip to content

Unix Screen


To start a screen session    : screen -S [screen-name] eg : screen -S vhi
To create a new window       : CTRL-a c
To list the current sessions : CTRL-a "
To rename a session          : CTRL-a A
To toggle between sessions   : CTRL-a # of session
To list the screens that
currently exist              : screen -ls
To attach and detach screens : screen -d -r [screen-name]
Note : You need to run this when you attach to a screen session remotely.
To stop terminal             : CTRL-s
To resume terminal           : CTRL-q
To split the screen horizontally : CTRL-a S
To jump between split screens : CTRL-a 
To close a split screen : Ctrl-a X
To clear the screen : CTRL-a C

To add some character to your screen session, add this to your ~/.screenrc :

#
# look and feel for the bottom two lines.
#
caption     always        "%{+b rk}%H%{gk} |%c %{yk}%d.%m.%Y | %72=Load: %l %{wk}"
hardstatus alwayslastline "%?%{yk}%-Lw%?%{wb}%n*%f %t%?(%u)%?%?%{yk}%+Lw%?"
#
#

This will give you hostname, date and load on one line, and the list of all screen
window names, with the current one highlighted in the second line. For deeper insights,
go here.

For a much bigger ready reckoner, go here