| Command | Description |
| sudo apt-get install screen | Install screen |
| screen | Launch screen |
| Ctrl-t, then d | Detach screen |
| screen -list | Show all available screen sessions |
| screen -r screen -r -t name |
Reattach to an existing screen session Reattach to the specific window name |
| Ctrl-t, then c screen screen -t name |
Create a new window The last command will create a window and give it a name |
| Ctrl-t, then " (double quotation) Ctrl-t, then 0 to 9 Ctrl-t, then Ctrl-t again |
Navigate windows by pressing up and down arrow keys, and enter to choose Jump to the window number specified Toggle between current and previous windows |
| exit Ctrl-t, then K Ctrl-t, then Ctrl-\ | Kill the current window Kill the current window Kill all windows and exit |
| Ctrl-t, then A | Annotate (name) the current window |
| Make a .screenrc file in home directory, with the following: hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a |
Each new window will display a status line, which will include the window's name |
| Ctrl-t, then ? | Help |
| screen -L Ctrl-t, then H |
Log the output from the current window to a file named ~/screenlog.n, where n is the window number Toggle logging on and off |
| Ctrl-t, then C | Clear a window |
If screen stopped responding:
List screens:screen -list
Output:
There is a screen on:
23536.pts-0.wdzee (10/04/2012 08:40:45 AM) (Detached)
1 Socket in /var/run/screen/S-root.
Kill screen session:
screen -S 23536 -X quit
screen -S 23536 -X quit
No comments:
Post a Comment