Skip to content

Instantly share code, notes, and snippets.

@awd-git
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save awd-git/f7fce0223e6fc21b1e28 to your computer and use it in GitHub Desktop.

Select an option

Save awd-git/f7fce0223e6fc21b1e28 to your computer and use it in GitHub Desktop.
Basics first
------------
Starting screen
---------------
Start screen by typing screen and hit enter
Confirm welcome message with space bar
C-a means nothing more than Ctrl-a
This basically makes screen listen to commands, i.e. any following key stroke is your requested action
C-a c // (c)reates a new window
You type Ctrl-a and then lower c
C-a n // go to (n)ext window
C-a p // go to (p)revious window
C-a N // where N is a number, jumps to that window
C-a A // opens a command line to name the current window
C-a " // opens a window with a full-list of all your windows
Monitoring
----------
If you set this for a screen you can go to other screens and will see a little notification at the bottom that one of either event has occured
C-a _ // makes the current window listening for 30 seconds of silence
C-a M // makes the current window listening for activity
Scrolling
---------
# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@
Titles
------
Adding a title for the current window
C-a A // replace the current name with most likely bash
Ending screen
-------------
C-a d // (d)etaches the screen session BUT all the windows are still running, i.e. you are only getting back to your previous shell
Reconnect to that screen session with screen -r
For ending screen completely you have to exit from each window and ultimately from the last remaining screen too
Reconnect screen session
------------------------
screen -ls // shows if a session exist
screen -r // reconnects to an existing session
If there is a session but listed attached the previous will fail
You have to run the following with the name you've seen with screen -ls
screen -D -r '1234.somescreensession'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment