Link Search Menu Expand Document

screen Cheat Sheet

CLI

screen                       # Start new instance
screen -S <name>             # Start named instance

screen -x                    # Attach to latest instance
screen -x <name>             # Attach to named instance

screen -ls                   # Show instances

Initial layout using .screenrc

Here is an example .screenrc that provides 3 panes with titles each running different commands inside

screen -t "top" top
split -v
focus
screen -t "df" watch df -h
split
focus
screen -t "Shell" bash

Use split and split -v to split horizontally or vertically. Also you need to use focus to move the initial cursor to the preferred pane.

You can also start specific screen sessions with other splitting by running screen -c <screenrc file>.

Screen compared to tmux

Here is a side by side comparison of screen and tmux commands and hotkeys.

FunctionScreentmux
Start instancescreen or screen -S <name>tmux
Attach to instancescreen -r <name> or screen -x <name>tmux attach
List instancesscreen -ls or screen -ls <user name>/tmux ls
New Window\^a c\^b c
Switch Window\^a n \^a p\^b n \^b p
List Windows\^a “\^b w
Name Window\^a A\^b ,
Split Horizontal\^a S\^b “
Split Vertical\^a |\^b %
Switch Pane\^a Tab\^b o
Kill Pane\^a x\^b x
Paging \^b PgUp \^b PgDown
Scrolling Mode\^a [\^b [