screen cheat-sheetStart a screen session:
$ screen(this will also open a window attached to the current screen)
In a screen session you can work with multiple windows.
- Open a new window:
ctrl-aand thenc - Go to the next window:
ctrl-aand thenn - Go to the previous window:
ctrl-aand thenp
Windows can be closed (killed) or detached. When detached, the process keeps running, but is not attached to the screen anymore. That way, when you quit the screen session, all detached windows will keep running any processes they were running (if you are working on a remote machine, you can logoff and they will keep running!)
Closing and detaching:
- Close the current window:
ctrl-aand thenk - Close the screen:
ctrl-aand then\(note that this will kill all windows!) - Detach a screen session:
ctrl-aand thend
You can list all the screens running in a machine (useful when leaving long processes running in remote machines):
$ screen -ls(this will list all the screen sessions running, each one with a unique ID)
To re-attach a detached window:
$ screen -r <screen_unique_ID>
If you need more help inside a window session:
ctrl-a and then ?
No comments:
Post a Comment