At some point, every engineer or researcher needs to work in the command line.
Tmux makes that work easier by keeping sessions alive, organizing multiple tasks, and letting you reconnect without losing progress. It is especially useful for remote servers, long-running jobs, and multitasking in a terminal.
Below is a concise and practical tmux cheat sheet covering the most useful commands for daily terminal workflows, session management, window navigation, and productivity.

Tmux is a terminal multiplexer that helps you manage multiple tasks and workflows.
With tmux, you can:
Sessions: Preserve your work and keep tasks running, even if you log out or disconnect.
Windows: Create separate workspaces for different projects or tools within the same session.
Panes: Split a window into multiple views so you can monitor and interact with several processes side by side.

Installing tmux
Linux
Often pre-installed.
macOS
Install it using Homebrew.
brew install tmuxWindows
Install via WSL (Windows Subsystem for Linux).
sudo apt update
sudo apt install tmuxStarting and exiting tmux sessions
Start a default session
tmuxStart a named session
tmux new -s <name>Detach from a session
Leave the current tmux session running in the background so you can come back to it later.
Ctrl-b d
Exit a session
Close tmux completely. This will terminate the application and end all running sessions.
Ctrl-d
Managing tmux sessions
List sessions
tmux lsAttach to a session
tmux a -t <name>Kill a session
tmux kill -t <name>Kill all sessions
tmux kill-serverTmux sessions
Rename current session
Ctrl-b $
Choose a session from a list
Ctrl-b s
Close a session
Ctrl-d
Tmux windows
Create a new window
Ctrl-b c
Rename a window
Ctrl-b ,
Move to next / previous window
Ctrl-b n
Ctrl-b p
Go to a specific window
Ctrl-b 0
Ctrl-b ...
Ctrl-b 9
List windows
Ctrl-b w
Close window
Ctrl-b &
Tmux panes
Split vertically
Ctrl-b %
Split horizontally
Ctrl-b "
Move between panes
Ctrl-b ← ↓ ↑ →
Resize a pane
Ctrl-b hold Ctrl ← ↓ ↑ →
Resize a pane (macOS only)
Ctrl-b hold Shift-Option ← ↓ ↑ →
Maximize/minimize a pane
Ctrl-b z
Change layout
Ctrl-b Space
Close a pane
Ctrl-d
Searching in tmux
You can search through your tmux history using copy mode. This allows you to scroll back and find specific text in the buffer.
1. Enter tmux copy mode
Ctrl-b [
2. Start a search
Search downwards:
Ctrl-s
Search upwards:
Ctrl-r
Type your search term and press Enter.
Press n to jump to the next occurrence.
Press N to jump to the previous occurrence.
4. Exit copy mode
Press q or Escape twice to exit copy mode.
Searching for a window in tmux
When you have multiple windows open, you can quickly jump to one based on text currently displayed inside it.
1. Open the find-window prompt
Ctrl-b f
2. Type your search term
Type the text you are looking for, then press Enter.
3. Select the matching window
If there’s only one match, tmux will switch to it automatically.
If multiple windows match, you’ll see a list and can choose the one you want.
This is just the beginning
We’ve demystified the essential tmux shortcuts you need to manage sessions, switch between windows, and stay organized while working in the terminal.
With these foundations in place, you’re ready to build a faster, more efficient command-line workflow using tmux every day.
This is just the beginning of your journey. May the Force be with you!
