Shortcuts[-][--][++]

The following are some of the most used shortcuts that lets you navigate through your screen environment. \
Note that unless modified by your .screenrc, by default every screen shortcut is preceded by Ctrl+a. \
Note that these shortcuts are case-sensitive (so use shift A and K...)

Dont forget to hit Ctrl+a first, then your command (not at same time)

  1. 0 through 9 - Switches between windows
  2. Ctrl+n - Switches to the next available window
  3. Backspace - Switches to the previous available
  4. Ctrl+a - Switches back to the last window you were on
  5. A - Changes window session name
  6. K - Kills a window session
  7. c - Creates a new window
  8. [ - Then use arrows to scroll up and down terminal
  9. ? - shows help
  10. : - allows for full name shortcuts like VIM, so Ctrl+a: then type help, is same as Ctrl+a?
  11. S - split screen horizontally
  12. TAB - goes to next split screen, then you can Ctrl+a 0 through 9 to make that split one of your screens

Find out about more shortcuts in Screen's man pages. In your

Persistant Screen[-][--][++]

I like to leave a screen session open on all my servers, then re-connect to them at the terminal or through ssh

  1. List any open screens screen -list will see the name like 1433.qserver (qserver would be the screen socket name)
  2. Create a new screen session screen -S somename
  3. Connect to existing screen screen -x somename or if you only have one screen backgrounded, just screen -x
  4. Detach (background) current screen Ctrl+a Ctrl+d

Multi User Mode[-][--][++]

On the server you must first set the SUID bit with sudo chmod +s /usr/bin/screen, then sudo chmod 755 /var/run/screen/. See http://www.pixelbeat.org/docs/screen/

  1. On the server side (lets say user hsever is creating a screen)
    1. Create new named session with screen -S coffeetime
    2. Enable multi user mode with :multiuser on
    3. Enable user mreschke to join :acladd mreschke
  2. On the client side (lets say user mreschke is connecting to hservers coffeetime screen session)
    1. screen -x hsever/coffeetime

Nice Looks[-][--][++]

Install screen profiles

sudo apt-get install screen screen-profiles screen-profiles-extras

Then run the command byobu to start screen, then press F9 for a nice config menu

Custom Config File[-][--][++]

Screen keeps its configuration file in the same vein that many applications do: in a dot file in your user's \
home directory. This file is aptly named .screenrc. In my experience, most people use ~/.screenrc to do two things:

  • Make a hardstatus line. This is basically a line at the bottom of the screen that lists your current terminal \

and all opened ones. It can also display the system clock and the hostname.

  • Default screens on startup. It's quite nice to have your IRC connection, mail client, and default SSH connections \

auto-start for you!

hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'

# Default screens
screen -t shell1    0
#screen -t shell2    1
#screen -t server    2    ssh me@myserver

Recources[-][--][++]