Master Linux Screen: Share Sessions, Keep Tasks Running, and Split Screens
This guide explains how to install GNU Screen, create and share sessions across multiple hosts, keep long‑running commands alive after network loss or window closure, and use Screen's split‑screen feature for multitasking in a Linux terminal.
Screen is a GNU‑developed command‑line terminal multiplexer that lets multiple terminal windows attach to the same shell session, allowing programs to keep running even if the network drops or a window closes.
Install Screen
sudo apt install screen -yOn CentOS you must first install epel-release before installing Screen with yum or dnf.
Session Sharing
Create a named session on host A: screen -S it From host B, list existing sessions: screen -ls Attach to the session: screen -x it Both hosts now share the same session; any command run on one is visible on the other. To leave the session, run exit or press Ctrl+A D to detach.
Keep Tasks Running After Disconnect
Run a long‑running command (e.g., ping 10.10.10.1) inside a Screen session on window A. From window B, you can verify the process with ps aux | grep ping. After closing window A, the ping continues running inside the detached Screen session, which you can later re‑attach with screen -r test.
Split‑Screen Usage
Create a new Screen session: screen -S test Press Ctrl+A then Shift+S to enable split screen.
Switch to the lower region with Ctrl+A Tab, then create a new window in that region with Ctrl+A C. Use Ctrl+A Tab to toggle between regions. Exit each region with exit, then detach or quit the whole session as needed.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
