Using tmux: A Terminal Multiplexer for Power Users
How to Use tmux: A Terminal Multiplexer for Power Users
tmuxis a game-changing terminal multiplexer that boosts productivity by managing multiple sessions, panes, and persistent workflows in one terminal. Ideal for developers, sysadmins, or anyone working on remote servers,
tmuxkeeps your tasks organized and resilient. This guide simplifies
tmuxusage with practical examples and tips to supercharge your command-line efficiency.
What is tmux?
tmux is an open-source terminal multiplexer that enables:
Multiple shell sessions inside one terminal
Persistent sessions (even after disconnection)
Pane and window splitting
Session sharing across users
Easy switching between tasks without leaving the terminal
It’s like having a tiling window manager for your terminal, available anywhere—even over slow SSH connections.
Installing tmux
On Debian/Ubuntu:
sudo apt install tmuxOn CentOS/RHEL:
sudo yum install tmuxOn macOS:
brew install tmuxGetting Started with tmux
To start a new tmux session:
tmuxYou’re now inside a new session. But to use it effectively, you’ll need to know some keybindings.
Default prefix: Ctrl + b
All tmux commands are triggered with a prefix key, which by default is:
Ctrl + bSo Ctrl + b, then % creates a vertical split, and so on.
Essential tmux Commands
| Command | Action |
|---|---|
| tmux | Start a new session |
| tmux new -s mysession | Start a named session |
| tmux attach -t mysession | Reattach to a session |
| tmux ls | List sessions |
| tmux kill-session -t mysession | Kill a session |
| exit | Exit current pane/window (or kill via tmux kill-pane) |
Advanced Tips and Tricks
1. Named Sessions for Persistence
tmux new -s setup-server("name-your-session")→ you have two horizontal panels: top and bottom
Reattach anytime:
🧮 2. Save Time with Sessions Scripts
Create .tmux.conf or shell scripts to automate setup:


