Skip to content

Instantly share code, notes, and snippets.

@nvasilakis
Forked from fredrick/screen.md
Last active June 2, 2020 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvasilakis/826e4f88d0e0dba2adf4df4834cb9394 to your computer and use it in GitHub Desktop.
Save nvasilakis/826e4f88d0e0dba2adf4df4834cb9394 to your computer and use it in GitHub Desktop.
GNU Screen Cheat Sheet

GNU Screen Cheat Sheet

Basics

Remember: in screen, all screen-related commands are prefixed by ctr-a (which means pressing ctrl and a together, and then pressing the followup character).

The 4 most basic commands (if you're new to screen, learn only these):

  • ctrl-a c -> create­ate new window
  • ctrl-a ctrl-a -> toggle between latest windows
  • ctrl-a " -> show all windows and choose using up/down arrows
  • ctrl-a d -> detach window

Less useful basics:

  • ctrl-a A -> set widow name
  • ctrl-a w -> show all window
  • ctrl-a 1|2|3|… -> switch to window n
  • ctrl-a ? -> help
  • ctrl-a [ -> start copy / scroll up; to copy: (1) move cursor to the start of the region to-be-copied; (2) press ENTER or space to start selecting chars and move towards the end of the region to-be-copied; (3) press ENTER / space to copy the selected chars to the buffer
  • ctrl-a ] -> paste from buffer

Starting screen

  • screen –DR -> list of detached screen
  • screen –r PID -> attach detached screen session (same with -x instead of -r)
  • screen –dmS MySes­sion -> start a detached screen session
  • screen –r MySes­sion -> attach screen session with name MySession

Advanced

  • ctrl a S -> create vertically split screen
  • ctrl a TAB -> switch between split screens
  • ctrl a Q -> Kill all regions but the current one.
  • ctrl a X -> remove active window from split screen
  • ctrl a O -> logout active window (disable output)
  • ctrl a I -> login active window (enable output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment