wiki:screen
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:screen [2020/04/29 14:40] – walkeradmin | wiki:screen [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 24: | Line 24: | ||
\\ | \\ | ||
\\ | \\ | ||
- | From a terminal in Linux, enter the following: | + | From a terminal in Linux, enter the following: |
\\ | \\ | ||
screen --version | screen --version | ||
- | If you see a version number, you are good to go, check out the section Using Screen. if you see the message <color # | + | If you see a version number |
\\ | \\ | ||
\\ | \\ | ||
---- | ---- | ||
- | === Installing Screen ==== | + | ==== Installing Screen ==== |
\\ | \\ | ||
+ | To install screen, open a terminal window and use the following command: | ||
+ | \\ | ||
+ | sudo yum install screen -y | ||
+ | \\ | ||
+ | You will see something very similar to the following: | ||
+ | < | ||
+ | sudo yum install screen -y | ||
+ | Loaded plugins: fastestmirror | ||
+ | Determining fastest mirrors | ||
+ | epel/ | ||
+ | * base: centos.mirroring.pulsant.co.uk | ||
+ | * epel: ftp.nluug.nl | ||
+ | * extras: mirror.mhd.uk.as44574.net | ||
+ | * updates: mirror.vorboss.net | ||
+ | base | 3.6 kB 00:00:00 | ||
+ | epel | 4.7 kB 00:00:00 | ||
+ | extras | ||
+ | updates | ||
+ | (1/7): base/ | ||
+ | (2/7): extras/ | ||
+ | (3/7): updates/ | ||
+ | (4/7): epel/ | ||
+ | (5/7): epel/ | ||
+ | (6/7): base/ | ||
+ | (7/7): epel/ | ||
+ | Resolving Dependencies | ||
+ | --> Running transaction check | ||
+ | ---> Package screen.x86_64 0: | ||
+ | --> Finished Dependency Resolution | ||
+ | |||
+ | Dependencies Resolved | ||
+ | |||
+ | ================================================================================================================================================ | ||
+ | | ||
+ | ================================================================================================================================================ | ||
+ | Installing: | ||
+ | | ||
+ | |||
+ | Transaction Summary | ||
+ | ================================================================================================================================================ | ||
+ | Install | ||
+ | |||
+ | Total download size: 552 k | ||
+ | Installed size: 914 k | ||
+ | Downloading packages: | ||
+ | screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm | ||
+ | Running transaction check | ||
+ | Running transaction test | ||
+ | Transaction test succeeded | ||
+ | Running transaction | ||
+ | Installing : screen-4.1.0-0.25.20120314git3c2946.el7.x86_64 | ||
+ | Verifying | ||
+ | |||
+ | Installed: | ||
+ | screen.x86_64 0: | ||
+ | |||
+ | Complete! | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | ---- | ||
+ | ==== Using Screen ==== | ||
+ | \\ | ||
+ | To start <color # | ||
+ | \\ | ||
+ | screen | ||
+ | \\ | ||
+ | You can check what screen commands are available by: Press <color # | ||
+ | |||
+ | < | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | break ^B b | ||
+ | clear | ||
+ | colon : | ||
+ | copy ^[ [ | ||
+ | detach | ||
+ | digraph | ||
+ | displays | ||
+ | dumptermcap . lastmsg | ||
+ | fit | ||
+ | |||
+ | ^] paste . | ||
+ | " | ||
+ | - select - | ||
+ | 0 select 0 | ||
+ | 1 select 1 | ||
+ | 2 select 2 | ||
+ | 3 select 3 | ||
+ | 4 select 4 | ||
+ | 5 select 5 | ||
+ | 6 select 6 | ||
+ | 7 select 7 | ||
+ | 8 select 8 | ||
+ | 9 select 9 | ||
+ | I login on | ||
+ | O login off | ||
+ | ] paste . | ||
+ | | split -v | ||
+ | :kB: focus prev | ||
+ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | **Starting a "Named Session" | ||
+ | \\ | ||
+ | \\ | ||
+ | You can name your screen sessions, which makes it easier to find the one you were in, you can do this using the following syntax: | ||
+ | \\ | ||
+ | screen -S session_name | ||
+ | \\ | ||
+ | For example <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | You will not see a lot happen, but a new window has opened and you are in a new session. | ||
+ | \\ | ||
+ | \\ | ||
+ | When you start a new screen session, it creates a single window with a shell in it. | ||
+ | \\ | ||
+ | \\ | ||
+ | You can have multiple windows inside a Screen session. | ||
+ | \\ | ||
+ | \\ | ||
+ | To create a new window with shell, type <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | Below are some most common commands for managing Linux Screen Windows: | ||
+ | \\ | ||
+ | \\ | ||
+ | Ctrl+a c Create a new window (with shell) | ||
+ | Ctrl+a " List all window | ||
+ | Ctrl+a 0 Switch to window 0 (by number ) | ||
+ | Ctrl+a A Rename the current window | ||
+ | Ctrl+a S Split current region horizontally into two regions | ||
+ | Ctrl+a | Split current region vertically into two regions | ||
+ | Ctrl+a tab Switch the input focus to the next region | ||
+ | Ctrl+a Ctrl+a Toggle between the current and previous region | ||
+ | Ctrl+a Q Close all regions but the current one | ||
+ | Ctrl+a X Close the current region | ||
+ | \\ | ||
+ | \\ | ||
+ | **Detach from Linux Screen Session** | ||
+ | \\ | ||
+ | \\ | ||
+ | You can detach from the screen session at any time by typing: | ||
+ | \\ | ||
+ | Ctrl+a d | ||
+ | \\ | ||
+ | The program running in the screen session will continue to run after you detach from the session. | ||
+ | \\ | ||
+ | \\ | ||
+ | **Reattach to a Linux Screen** | ||
+ | \\ | ||
+ | \\ | ||
+ | To resume your screen session use the following command: (and this is the whole point of this article :) ) | ||
+ | \\ | ||
+ | screen -r | ||
+ | \\ | ||
+ | \\ | ||
+ | In case you have multiple screen sessions running on your machine, you will need to append the screen session ID after the r switch. | ||
+ | \\ | ||
+ | \\ | ||
+ | To find the session ID list the current running screen sessions with: | ||
+ | \\ | ||
+ | screen -ls | ||
+ | \\ | ||
+ | Output is: (your session numbers/ | ||
+ | \\ | ||
+ | < | ||
+ | There are screens on: | ||
+ | 10835.pts-0.linuxize-desktop | ||
+ | 10366.pts-0.linuxize-desktop | ||
+ | 2 Sockets in / | ||
+ | </ | ||
+ | \\ | ||
+ | If you want to restore screen 10835.pts-0, | ||
+ | \\ | ||
+ | screen -r 10835 | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ---- | ||
+ | \\ | ||
+ | Plagurised from : [[https:// | ||
wiki/screen.1588167616.txt.gz · Last modified: 2023/03/09 22:35 (external edit)