Follow me on https://linkedin.com/in/yurislobodyanyuk/ for updates.
Note
|
C-a below stands for Ctrl + a keyboard sequence.
|
Command | Description |
---|---|
~/.screenrc & /etc/screenrc |
Commands that the |
screen -ls |
List active screen sessions |
screen -Q windows |
List windows' names inside screen session |
screen -S <session name> |
Create a new screen session with the name <session name> |
screen -x screen -r <session name> |
Attach to the running session, also by its name |
screen -dRR |
Attach to the screen session, detach on other display if attached. If no session exists, will create a new one. |
C-a d |
Detach from the session, session keeps running. Here, and further C means Ctrl. |
C-a c |
Create new window in the session. |
C-a C-a |
Switch to the previous window. |
C-a " |
List all windows with option to navigate and enter any of them. |
C-w |
Show a list of active windows with their numbers. |
C-a <number> |
Switch to the window number number. |
C-a ' |
Switch to the window by its name. |
C-a n |
Switch to the next window. |
C-a p |
Switch to the previous window. |
exit |
Exit and close current window. If it was the last window in a session, exits |
C-a k |
Kill the current window forcefully (not recommended). |
C-a : quit |
Quit screen session completely terminating it. Alternatively - exit all screen windows. |
C-a A |
Rename current window. |
C-a S |
Split windows display horizontally. Use C-a c to create a new window inside the new split or C-X to close this part of split. |
C-a | |
Split windows display vertically. Available starting screen 4.01, i.e. not available on Mac 2020 which still uses screen 4.00. |
C-a tab |
Jump to the next region in a split window display. |
C-a Q |
Unsplit the window, leaving the current window active. |
C-a [ or C-a <esc> |
Enter buffer navigation mode to scroll output buffer, copy, edit and paste later. Navigation commands as per |
<space> |
Start/stop selection while in the buffer mode to select the text. Press |
C-a ] |
Paste the selected text at the cursor of the terminal, or create a new window and say start Vim there and paste into it while in Insert mode. |
C-a h |
Dump the contents of the currently visible terminal to |
C-a H |
Start/end logging all output of the curent window into a file |
C-a a |
Send |
C-a M |
Monitor window for activity. When enabled, will notify you of any acitvity while you work in other window. |
C-a _ |
Monitor window for 30 seconds of silence, will notify you in any other window as |
C-a ? |
Show all key bindings help. |
Save session state |
This is not possible. If you use the same layout each session, you can put start up commands to re-create it in |
Sharing session (e.g. for pair programming/tutoring) |
|
Original session (say user1):
Connecting user (say user2):
|
Sets up sharing the session. Another user connecting to the session views real-time its output, can enter and run commands himself. Also see aclchg, acldel, aclgrp for controlling what the connecting user can and cannot do. E.g. to remove write permissions from all users on all windows: |
C-a * |
See who is connected to your shared screen session. |
Follow me on https://linkedin.com/in/yurislobodyanyuk/ for updates.