tmux Cheatsheet
tmux Terminal Multiplexer Guide
This guide provides a comprehensive cheatsheet for the tmux terminal multiplexer, covering installation, window management, pane manipulation, and essential commands to enhance your command-line productivity.
Installation Guide
Ubuntu Installation
To install tmux on Ubuntu systems, use the following commands:
sudo apt update
sudo apt install tmux -y
tmux Plugin Manager (TPM) Installation
Install the tmux plugin manager for easier plugin management:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Tmux Configuration Setup
Create the tmux configuration directory and file:
mkdir -p ~/.config/tmux
touch ~/.config/tmux/tmux.conf
Add the following content to your ~/.config/tmux/tmux.conf file:
# Initialize TPM
set -g @plugin 'tmux-plugins/tpm'
# Sensible defaults for tmux
set -g @plugin 'tmux-plugins/tmux-sensible'
# Load TPM
run '~/.tmux/plugins/tpm/tpm'
After saving the configuration, you can source it within tmux using:
tmux source-file ~/.config/tmux/tmux.conf
Essential tmux Cheatsheets
The default prefix key combination is Ctrl+b. You'll press this before most tmux commands.
Window Management
- Create New Window: Press
Prefix + c - Switch Between Windows: Press
Prefix + [number](e.g.,Prefix + 1for window 1), or usePrefix + nfor the next window andPrefix + pfor the previous window.
Pane Splitting and Management
- Split Window Horizontally: Press
Prefix + % - Split Window Vertically: Press
Prefix + " - Switch Between Panes: Use the arrow keys after pressing the prefix:
Prefix + ←,Prefix + →,Prefix + ↑,Prefix + ↓. - Show Pane Numbers: Press
Prefix + qto display numbers for each pane, then press the desired pane number to switch to it. - Zoom Pane: Press
Prefix + zto toggle fullscreen for the current pane. - Close Pane: Press
Prefix + x(you will be prompted to confirm).
Further Resources
For more in-depth information and advanced usage, consult these resources: