GNU screen usageThis is a summary of some common command-line options and keystrokes for use in the terminal multiplexer GNU screen. For more details, see screen's man page. All commands (except in copy/scrollback mode or command-line mode) start with the command character, which is assumed here to be the default Ctrl+A (notated here as "C-a").
Basic command-character commandsC-a ? Help. C-a a Send the command character itself ("C-a") to the program running in the current window. C-a " Present a list of all windows for selection. Use the arrow or number keys (or vi- or Emacs-style cursor keys) to highlight a window and press <Enter> to switch to it. C-a 0 Switch to window number 0 (works with 0-9). C-a C-a Toggle to the window displayed previously. (If you're using another command character, substitute it for both these "C-a"s.) C-a A Change the current window's title. C-a c Create a new window with a shell and switch to that window. C-a <Esc> Enter copy/scrollback mode. (See "Copy/scrollback mode" section below.) C-a ] Send the contents of the paste buffer to the program running in the current window. (See "Copy/scrollback mode" section below.) C-a t Show time, date, hostname, and some other stuff. C-a @ Do nothing. (Useful when you hit "C-a" by mistake.) C-a : Enter command line mode. (For example, "C-a :number 7" changes the window number of the current window to 7. See the man page for more details.) C-a C-z Suspend screen. (You will be back at the shell you started screen from.) C-a d Detach screen. (Do this before you log out -- you will be back at the shell you started screen from.)
Copy/scrollback modeh,j,k,l Move cursor left, down, up, right (as in vi). Regular arrow keys also work. C-b Page up (<PageUp> key also works). C-f Page down (<PageDown> key also works). <Space> Set mark. When the second mark is set, the text between the two marks will be put into screen's paste buffer and copy/scrollback mode will be exited. ^ Move to first nonwhitespace character on current line. $ Move to last nonwhitespace character on current line. 0 Move to leftmost column. c Set the left margin for block-mode copying. C Set the right margin for block-mode copying. x Exchange the first mark with the current cursor position. This is good for moving an already set mark. <Esc> Exit copy/scrollback mode. (Any key that doesn't have another meaning will do this.)
Regions Regions allow looking at two or more screen windows at the same time. C-a S Split the current region into two new ones. (The blank window will be displayed in the new region until you use one of the window selection commands.) C-a <Tab> Switch focus to the next region. C-a Q Delete all regions but the current one. (This does not destroy any windows.)