Screen Commands
In normal terminal
screen -S <sessionname>
Start a new screen session with a given name and attach to it.
screen -ls
Lists all existing screen sessions.
screen -r
Reattach this terminal to the only existing screen session.
screen -r -S <sessionname>
Reattach this terminal to an existing screen session by name.
screen -S <oldname> -X <newname>
Rename a screen session.
screen -S <sessionname> -X quit
Kill the specified screen session by executing quit.
Within a screen session
Prepend every command with ctrl + A
Ctrl+A - ?
Show help
Ctrl+A - d
Detach the current screen session from this terminal. The screen session and its processes remain in existence.
Ctrl+A - c
Create a new window and switch to it.
Ctrl+A - k (y)
Kill the current window.
Ctrl+A - p
Go to the previous screen.
Ctrl+A - n
Go to the next screen.
Ctrl+A - <number>
Go to a specific screen number.
Ctrl+A - "
Go to the screen selection page. Select a screen from the list using the arrow keys.
Ctrl+A - S
Split the current window in half horizontally.
Ctrl+A - |
Split the current window in half vertically.
Ctrl+A - Tab
Cycle through window regions.
Ctrl+A - X
Eliminate a window split.
See if you are inside a screen
echo $TERMnormal ssh session:
$ echo $TERM
xterm-256colorinside screen:
$ echo $TERM
screen.xterm-256colorscrolling in screen:
Ctrl+A - [
Press ESC to resume normal operation
enable normal scrolling:
Last updated
Was this helpful?