Linux 1. Using Linux screen utility.
Screen is utility allowing you to open several terminal instances inside a single terminal window connection.
To install screen:
yum install screen -y
To install screen:
yum install screen -y
Using screen
- Opening new screen session:
- Create screen with default name (screen will be named <pid>.<tty>.<host>):
- screen
- Create screen with custom name (<pid>.<custom-name>), i.e. wget-download. This gives ability to distinguish between present screens by name:
- screen -S wget-download
- To view all screen options:
- hit and release Ctrl+A and then hit ?
- To detach (disconnect) from current screen (you'll see "[detached from ..]" message):
- hit and release Ctrl+A and then hit d
- To list all available screens (number left to the ".pts" is screen id). (Detached) means nobody connected, (Attached) means that somebody is currently in that screen:
- screen -ls
- To reattach (reconnect) to the needed screen:
- By id:
- screen -r 12215
- By custom-name:
- screen -r wget-download
- Connect to already attached screen:
- screen -d -r 12215
- To lock current screen (password of the local user will be needed):
- hit and release Ctrl+A and then hit x
- To work with nested screen (screen id remains the same but you can switch between nested screens and prompt will show: screen 0 / screen 1 etc. when switching):
- To create nested screen:
- being inside screen hit and release Ctrl+A and then hit c
- To switch between nested screens:
- being inside screen hit and release Ctrl+A and then hit n (for next nested screen) or p (for previous nested screen)
- To list all nested screens:
- being inside screen hit and release Ctrl+A and then hit " (double quote - Shift+single quote)
- To "kill" screen:
- to terminate current screen type exit
- to terminate any screen using it's id (scree id is system pid):
- kill pid
No comments:
Post a Comment