# Screen Cheatsheet / Quick Reference (Pocket Friendly) ## Escape Key All screen commands are prefixed by an escape key, by default Ctrl-a (that's Control-a, sometimes written ^a). To send a literal Ctrl-a to the programs in screen, use Ctrl-a a. This is useful when when working with screen within screen. For example Ctrl-a a n will move screen to a new window on the screen within screen. | Description | Command | |---------------------------------------|-------------------------------------------------------| | **Basic** || | Start a new session with session name | `screen -S ` | | List running sessions / screens | `screen -ls` | | Attach to a running session | `screen -x` | | Attach to a running session with name | `screen -r ` | | Detach a running session | `screen -d ` | | Kill a screen | `screen -XS quit` | | **Getting Out** || | detach | `Ctrl-a d` | | detach and logout (quick exit) | `Ctrl-a D D` | | exit screen | `Ctrl-a :` quit or exit all of the programs in screen.| | force-exit screen | `Ctrl-a C-\` (not recommended) | | kill screen | `Ctrl-a k` | | **Help** || | See help | `Ctrl-a ?` (Lists keybindings)| | **Window Management** || | Create new window | `Ctrl-a c` | | Change to last-visited active window | `Ctrl-a Ctrl-a` (commonly used to flip-flop between two windows) | | Change to window by number | `Ctrl-a ` (only for windows 0 to 9) | | Change to window by number or name | `Ctrl-a ' ` | | Change to next window in list | `Ctrl-a n` or `Ctrl-a ` | | Change to previous window in list | `Ctrl-a p` or `Ctrl-a ` | | See window list | `Ctrl-a "` (allows you to select a window to change to) | | Show window bar | `Ctrl-a w` (if you don't have window bar) | | Kill current window | `Ctrl-a k` (not recommended) | | Kill all windows | `Ctrl-a \` (not recommended) | | Rename current window | `Ctrl-a A` | | **Split screen** || | Split display horizontally | `Ctrl-a S` | | Split display vertically | `Ctrl-a \|` or `Ctrl-a V` (for the vanilla vertical screen patch) | | Jump to next display region | `Ctrl-a tab` | | Remove current region | `Ctrl-a X` | | Remove all regions but the current one| `Ctrl-a Q` | | **Misc** || | Redraw window | `Ctrl-a C-l` | | Enter copy mode | `Ctrl-a [` or `Ctrl-a ` (also used for viewing scrollback buffer)| | Paste | `Ctrl-a ]` | | Monitor window for activity | `Ctrl-a M` | | Monitor window for silence | `Ctrl-a _` | | Enter digraph (for producing non-ASCII characters) | `Ctrl-a Ctrl-v` | | Lock (password protect) display | `Ctrl-a x` | | Enter screen command | `Ctrl-a :` | | Enable logging in the screen session | `Ctrl-a H` | | **More References** | [Blackhillsinfosec QuickRef](https://www.blackhillsinfosec.com/gnu-screen-quick-reference/) + [Aperiodic QuickRef](http://aperiodic.net/screen/quick_reference) + [TomLee Splitting](https://tomlee.co/2011/10/gnu-screen-splitting/) + [Neophob Cheat Sheet](http://neophob.com/2007/04/gnu-screen-cheat-sheet/) + [CatOnMat Cheat Sheet PDF](https://catonmat.net/ftp/screen.cheat.sheet.pdf) | ## Navigating up/down inside the buffer * Hit your screen prefix combination `(C-a)`, then hit Escape. * Move up/down with the arrow keys (`↑ and ↓`). * When you're done, hit `q` or `Escape` to get back to the end of the scroll buffer. ###### Original Source: [JCTosta - Screen Quick Reference](https://gist.github.com/jctosta/af918e1618682638aa82)