Using Screen

Until recently, I had never used screen. Now I love it! Screen is awesome.

In short, screen is a virtual terminal session that allows multiple windows within a single ssh session. It also maintains your session if you lose a connection.

start screen:
$ screen

to create a new window:
cntrl-a c

to exit a window:
$ exit

to switch windows:
cntrl-a n   (next)
cntrl-a p   (previous)

cntrl-a ?

to detach your session from screen:
cntrl-a d

to find a screen session:
$ screen -ls
There is a screen on:
	6173.pts-1.localhost	(Detached)
1 Socket in /var/run/screen/S-root.

to reattach to a screen session:
$ screen -r
$ screen -r 6173.pts-1.localhost

Leave a Comment