DEV Community

chair
chair

Posted on • Edited on

Screen commands

Screen is useful for running long scripts on linux virtual machines where you don't want to risk termination due to a disconnection.

The following commands are all you will ever need, probably. Most of the time.

download: sudo yum install screen
list sessions: screen -ls
start session: screen
detach from session: ctrl a + d
re-attach: if there is only one session running you can do screen -r else do screen -ls and get the desired session id and do screen -r <SESSION_ID>
kill session from inside the session: ctrl a + k + y
enable vertical scrolling: ctrl a + ESC

A lovely cheatsheet I forked from someone wiser than I, who also forked it from someone before them:
https://gist.github.com/aarobender/a503231e83b862c3757ab6527bdfc812

Top comments (0)