Screen Cheat Sheet

Screen Cheat Sheet & Quick Reference

Sessions

screen

Start a new session

screen -S mysession

Start a new session with the name mysession

Ctrl + a :sessionname newname

Rename session to newname

Ctrl + a d

Detach from session

screen -d name

Detach a running session

screen -r mysession

Attach to a session with the name mysession

screen -ls

List running sessions / screens

Windows

Ctrl + a c

Create window, run console

Ctrl + a A

Rename current window

Ctrl + a k   or
Ctrl + a :remove

Close current window

Ctrl + a \

Close all windows

Ctrl + a Ctrl + a

Last-visited active window

Ctrl + a p

Previous window

Ctrl + a n

Next window

Ctrl + a 0 ...9

Select window by number

Split Screen

Ctrl + a S   or
Ctrl + a :split

Split display horizontally

Ctrl + a |   or
Ctrl + a :split -v

Split display vertically

Ctrl + a tab

Jump to next display region

Ctrl + a :"

Navigate between screen

Ctrl + a X

Remove current region

Ctrl + a Q

Remove all regions but the current one

Ctrl + a :layout save default

Save splitting position

Misc

Ctrl + a [

Enter copy mode

Ctrl + a ]

Paste

vi ~/.screenrc

Edit configuration file

Ctrl + a :

Enter screen command

Ctrl + a Ctrl + l

Redraw window

# Use bash
shell /bin/bash

autodetach on

# No annoying startup message
startup_message off

# Display the status line at the bottom
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.kW}%-w%{.bW}%t [%n]%{-}%+w %=%{..G} %H %{..Y} %Y/%m/%d %c"

# Setup screens
chdir /home/pi/ # All screens start in ~/Sites folder
screen -t 'server' 0 bash # Make first screen for running server
screen -t 'specs' 1 bash # Make screen for running tests
screen -t 'workspace' 2 bash # Make screen for general work i.e. running git commands

Config sample for ~/.screenrc

Help

screen --help

Show help

Ctrl + a ?

Show shortcuts