Skip to content

Instantly share code, notes, and snippets.

@jakxx
Forked from emadehsan/Screen Unix Cheat Sheet.md
Created April 17, 2019 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakxx/3c02940e46b5ce89e9295a2abf6cf000 to your computer and use it in GitHub Desktop.
Save jakxx/3c02940e46b5ce89e9295a2abf6cf000 to your computer and use it in GitHub Desktop.
Screen Linux/Unix command cheat sheet

Install Screen

$ sudo apt install screen

Enter a new Screen Session

$ screen

Detach from current screen session

Ctrl + a + d

List screen sessions

$ screen -ls

List the processes

$ ps -e | grep PID_OF_SCREEN_SESSION

Enter a new screen session & giving it the name newScreenSession

$ screen -S newScreenSession

Reattach to a screen session

$ screen -r PID_OF_SCREEN_SESSION

Execute a command in a screen session (quit command in this case)

$ screen -X -S PID_OF_SCREEN_SESSION quit

Kill a session from within it

Ctrl + a + k

It is actually for killing windows from within screen sessions.

New Windows Session from within screen

Ctrl + a + c

List all windows in a session

Ctrl + a + w

Ctrl a "

Ctrl a n: move to next window

Ctrl a p: move to previous window

Kill all windows & session

Ctrl a \

Divide in the panes

Ctrl a |

Move to sibling pane

Ctrl a tab

Divide in the panes Horisontal

Ctrl a S

Remove a pane

Ctrl a X

Lock a session with a password

Ctrl a x

Run a command in a screen

$ screen -d -m python script.py

Screen bindings / help

Ctrl a ?

Type a screen binding command

Ctrl a :

Reference: https://www.youtube.com/watch?v=I4xVn6Io5Nw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment