Skip to content
Master tmux: Create, Manage, and Recover Terminal Sessions Like a Pro
Operations 4 min read

Master tmux: Create, Manage, and Recover Terminal Sessions Like a Pro

This guide explains how to install tmux, create and name sessions, detach and reattach them, manage multiple windows and panes with keyboard shortcuts, and safely close windows, providing a complete workflow for reliable terminal multiplexing on Linux systems.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations

tmux is a terminal multiplexer similar to Screen that keeps programs running when a terminal disconnects and lets you split a terminal window into multiple sessions for multitasking.

tmux is pre‑installed on Ubuntu, but on CentOS you need to install it manually: # yum install tmux -y To create a new tmux session named test : tmux new-session -s test Exit a tmux session with the exit command or Ctrl + D . exit If the window closes or the network drops, you can restore the session with: tmux attach-session -t test List all active tmux sessions using: tmux ls Create a new window inside the current session by pressing Ctrl + B then C :

The status line at the bottom shows the number of open windows (e.g., 0, 1, 2). The asterisk (*) marks the currently active bash window.

Switch to a specific window by pressing Ctrl + B followed by its number (e.g., 0 ).

Close a window: switch to it, press Ctrl + B then X , confirm with Y when prompted.

Split the current window horizontally with Ctrl + B then % (Shift + 5):

Split vertically with Ctrl + B then " (Shift + comma):

Navigate between panes: press Ctrl + B then O to move to the next pane (top‑to‑bottom, left‑to‑right), or press Ctrl + B then ; to toggle between the current and previous pane.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Session ManagementTMUX
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.