Simple sysadmin tools - Screen on CentOS

Feb 4th, 2015 in Servers and Scaling by Michael Cho

← All articles

Screen is one of my favourite utilities when managing servers - it allows you to use multiple shell windows from a single SSH session and to keep these active even after logging out. It is super useful for monitoring long-running processes.

Installing Screen on CentOS

[ ~]$: yum install screen


Creating a new screen

[ ~]$: screen


Detaching from an active screen

Ctrl-A D


Force detaching from another session

[ ~]$: screen -d


Listing all screens

[ ~]$: screen -ls


Re-attaching to a screen

[ ~]$: screen -ls

There is a screen on:
	2257.pts-0.myServer	(Detached)
1 Socket in /var/run/screen/S-my_root.

[ ~]: screen -r 2257


Exiting a screen

[ ~]$: exit