How to use Linux Screen

Screen is one of the powerful command in Linux(Unix System) that allow user to run command in remote mode and this is to avoid connection timed out or etc issue causing the previous launched command stopped.

You may install screen by running yum or apt-get depending on your box, then you can start screen by typing screen at the command prompt.


Once screen session has started, you can use the following commands to mess around:

– Ctrl + A + ‘c’ = To open a New Windows
– Ctrl + A + ‘n’ = next window (if you have multiple windows running)
– Ctrl + A + ‘0…9’ = go to window number x where it should come with 0 to 9.
– Ctrl + A + ‘d’ = detach from a window. Say, if you want to close your session and return later.
– Ctrl + ‘d’ = detach and clear the screen session,

To re-attach to a screen, you may need to check the number of screen is running.

screen -ls

This will display the screens currently running, you could run the command as below to resume the screen session.
[code]$ screen -x pid.tty.user[/code]

Published by

Mick Genie

Mick Genie is the founder of and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.