User Tools

Site Tools




Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

  • Configuration

In ~/.screenrc

# this will give you a nice bottom status bar
hardstatus alwayslastline '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'

  • Commands

Note: pay attention that “A” is different from “a”. For “A” you should press Shift+a or use CapsLock to insert it.

Before entering the screen
screen -ls list available sessions
screen -r XXXX reattach to the screen session (specify XXXX id if multiple)
Attach / Detach
Ctrl+a c creates a new window inside screen
Ctrl+a Ctrl+d detach the current screen session
Ctrl+a 0,1,2… moves to window 0,1,2…
Ctrl+a K kill a window
Windows operations
Ctrl+a A changes the name of the window
Ctrl+a ? get help
Ctrl+a n go to the next window
Ctrl+a p go to the previous window
Ctrl+a Ctrl+a cycle between current and last window you were in
Ctrl+a “ get a list of open windows; you can select from here
Ctrl+a F or :fit fits the screen to the new terminal size
General operations
Ctrl+a H enable logging
Ctrl+a M monitor for activity(alert at the bottom)
Ctrl+a _ monitor for silence(alert at the bottom)
Ctrl+a x lock the session with a password
Splitting into regions
Ctrl+a S Splits horizontally a window into regions
Ctrl+a :resize resize (asks for lines) the region
Ctrl+a :remove removes selected region
Ctrl+a <tab> jump to another region (no window inside)
Ctrl+a [ enter copy mode, use arrows to navigate and Enter to set marks
Ctrl+a ] paste the buffer
Ctrl+a > write paste buffer to file (useful for copying between screens)
Ctrl+a < read paste buffer from file (useful for pasting between screens)
linux/screen_utility.txt · Last modified: 2013/03/16 17:40 (external edit)