I will be explaining how to use screen without too much theory and talk.
Starting a new screen session or reattach to existing session:
$ screen -R
List all the screen sessions:
$ screen -ls
Creating a new virtual terminal (from inside the screen session):
Ctrl-a, c
Detaching from the virtual terminal back to the CLI:
Ctrl-a, d
Hop to the next/previous virtual terminal:
Ctrl-a, n and Ctrl-a, p
Hop to a virtual terminal number:
Ctrl-a, 0-9
Kill all virtual terminals:
Ctrl-a, \
Password protect a screen session (lock):
Ctrl-a, x
Help on interactive screen commands:
Ctrl-a, ?
Example of usage of putting a couple of screens on a server, one for top, another for vmstat and another one for iostat:
Main Terminal:
james@earth:~$ screen -R
Virtual Terminal 0:
james@earth:~$ top[ Press Ctrl-a, c to create a new virtual terminal ]
Virtual Terminal 1:
james@earth:~$ vmstat 5[ Press Ctrl-a, c to create a new virtual terminal ]
Virtual Terminal 2:
james@earth:~$ iostat 5[ Press Ctrl-a, c to create a new virtual terminal ]
Hop to the virtual terminal showing top:
[ Press Ctrl-a, 0 to go to terminal 0 ]
Detach from screen and return to main terminal window:
[ Press Ctrl-a, d ]
Display list of screen sessions:
james@earth:~$ screen -ls There is a screen on: 2055.pts-0.earth (04/22/2012 09:41:33 AM) (Detached) 1 Socket in /var/run/screen/S-james.
No comments:
Post a Comment