Skip to content

Instantly share code, notes, and snippets.

@shreyansb
Created October 19, 2011 17:42
Show Gist options
  • Save shreyansb/1299071 to your computer and use it in GitHub Desktop.
Save shreyansb/1299071 to your computer and use it in GitHub Desktop.
intro to screen
# create screen. can optionally specify the process to run in it here,
# or can do that when the screen has started
$ screen -S firstscreen
# run a process in it
(inscreen)$ processone
# get out of the screen: 'ctrl-a + d' ('d' for detach)
> ctrl-a + d
[detached from 24550.firstscreen]
# list screens
$ screen -list
There is a screen on:
24152.firstscreen (10/19/2011 10:24:05 AM) (Detached)
1 Socket in /var/run/screen/S-vagrant.
# get back into the screen (dont need to specify which one if there's only one)
$ screen -r
# and you're back in!
# create another screen and specify the task in the invocation
$ screen -S secondscreen processtwo
# watch it run.
# detach it
> ctrl-a + d
$ screen -list
There are screens on:
24550.firstscreen (10/19/2011 10:34:09 AM) (Detached)
24524.secondscreen (10/19/2011 10:32:52 AM) (Detached)
2 Sockets in /var/run/screen/S-vagrant.
# kill a screen by getting back into it and typing ctrl-a + k
$ screen -r secondscreen
> ctrl-a + k
$ screen -list
There is a screen on:
24152.firstscreen (10/19/2011 10:24:05 AM) (Detached)
1 Socket in /var/run/screen/S-vagrant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment