Overview
Linux
screen is a command-line tool that lets you run multiple terminal sessions in a single window or remotely. It's useful for managing multiple sessions and can keep them running even if you lose your connection. It has features like detaching and reattaching to sessions, splitting your terminal into multiple regions, and sharing sessions with other users.Basic commands
- Start a new session:
screen -S <session name>
- List running sessions:
screen -ls
- Attach to a running session:
screen -r <session name>
- Detach from a session:
ctrl+afollowed byd
Working in multiple windows
- Create a new window:
ctrl+afollowed byc
- Switch to another window:
ctrl+afollowed by"
- Kill current window:
ctrl+afollowed byk
Split screen into multiple regions
One of the most powerful features of screen is the ability to split your terminal window into multiple regions, each running its own shell.
- Split screen horizontally:
ctrl+afollowed byS(upper case)
- Split screen vertically:
ctrl+afollowed by|
- Switch between different regions:
ctrl+afollowed bytab
- Remove current region:
ctrl+afollowed byX(upper case)
- Un-split all regions for the current layout:
ctrl+afollowed byQ(upper case)
- Save current layout:
ctrl+afollowed by:then type the following commandlayout save mylayout
