Alaya NeW Cloud

Tmux for terminal multiplexing

Terminal multiplexer essentials — the session / window / pane model, and keeping tasks alive after SSH disconnects

tmux is a powerful terminal multiplexer that lets you manage multiple sessions, windows, and panes inside a single terminal — your tasks keep running in the background even after SSH disconnects.

Key capabilities:

  • Session management: create, detach from, and reattach to different tmux sessions. Sessions keep running in the background after SSH disconnects, so you can pick up where you left off.
  • Windows and panes: each session can hold multiple windows, and each window can be split into multiple panes — driving several programs from a single screen.
  • Persistence: ideal for long-running tasks (data-processing scripts, server monitoring, etc.); reattach from any device to continue.
  • Collaboration: multiple users can share the same session in real time, which is great for teamwork.
  • Keyboard shortcuts: most actions are triggered with the prefix key Ctrl+b.
  • Configurable: customize keybindings, layouts, and appearance through ~/.tmux.conf.

Installation

Debian / Ubuntu

apt-get update -y
apt-get install tmux

RHEL / CentOS

yum update -y
yum install tmux

Common commands

Session management

ActionCommand
Create an unnamed sessiontmux
Create a named sessiontmux new -s session_name
List all sessionstmux ls
Reattach to the default sessiontmux attach
Reattach to a specific sessiontmux attach -t session_name
Rename a sessiontmux rename-session -t old_name new_name
Kill a sessiontmux kill-session -t session_name
Detach from the current sessiontmux detach or Ctrl+b d

After detaching, you can close the terminal window and the session keeps running in the background.

Window management

ActionCommand
Create a new windowtmux new-window or Ctrl+b c
List all windowsCtrl+b w
Rename a windowCtrl+b , then type a name and press Enter
Switch to a window by indexCtrl+b <number>
Switch to the previous windowCtrl+b p
Switch to the next windowCtrl+b n
Close a windowexit or Ctrl+d

Pane operations

ActionCommand
Split horizontally (top/bottom)Ctrl+b "
Split vertically (left/right)Ctrl+b %
Move the cursor between panesCtrl+b <arrow>
Cycle the cursor through panesCtrl+b o
Close the current paneexit

Further reading

For more on tmux, see the tmux handbook.

Last updated on

Was this page helpful?

On this page