Master tmux on Linux: Create, Manage, and Navigate Sessions Efficiently
This guide explains how to install tmux on CentOS, create and name sessions, detach and reattach them, list existing sessions, and use keyboard shortcuts to open, switch, split, and close windows, providing practical commands and visual examples for seamless terminal multiplexing.
tmux is a terminal multiplexer similar to Screen that keeps programs running when a terminal disconnects and allows a single terminal window to host multiple sessions, greatly simplifying multitasking.
On Ubuntu tmux is pre‑installed, but on CentOS you need to install it manually: # yum install tmux -y To start a new session named test: tmux new-session -s test Exit a session with the exit command or Ctrl +D . The session continues running in the background.
When the window closes or the network drops, reattach the session with: tmux attach-session -t test List all active sessions using: tmux ls Inside a session you can create additional windows. Press Ctrl +B then C to open a new window. The status line at the bottom shows the window numbers (e.g., 0, 1, 2).
Switch to a specific window by pressing Ctrl +B followed by the window number (e.g., 0 ).
Close the current window by pressing Ctrl +B , then X , and confirming with Y .
For side‑by‑side comparison, split the current window horizontally with Ctrl +B then % (Shift + 5). This creates a new pane independent of other windows.
Split vertically with Ctrl +B then " (Shift + comma). This creates a new vertical pane.
Navigate between panes: Ctrl +B then O cycles through panes from top‑to‑bottom and left‑to‑right; Ctrl +B then ; toggles between the current and previous pane.
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.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
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.
