A Reference Of Linux Screen Commands Because I Keep Forgetting Them
screen is a command that allows you to:
- Use multiple shell windows from a single SSH session.
- Keep a shell active even through network disruptions.
- Disconnect and re-connect to a shell sessions from multiple locations.
- Run a long running process without maintaining an active shell session.
Starting Linux Screen
Screen is started from the command line just like any other command:
You are now inside of a window within screen. This functions just like a normal shell except for a few special characters.
Screen uses the command
Ctrl-a” as a signal to send commands to screen
instead of the shell.
Ctrl-a ? gives you the key bindings page.
Detaching From Screen
You can detach from the window using
Reattach to Screen
If your connection drops or you have detached from a screen, you can re-attach by just running:
To stop the screen session, enter
exit into the shell or use
To run a single command in screen and detach:
To run multiple commands:
To list all sessions:
Please note that when a program terminates, screen (per default) kills the window that contained it.