Contents

tmux Quick Start Guide

๐Ÿงช Quick Guide to tmux

tmux (terminal multiplexer) lets you run multiple terminal sessions in one window โ€” detach and reattach them at will. It’s ideal for remote work and multitasking in the terminal.


๐Ÿš€ Start a New Session

1
tmux new -s mysession

This creates a new tmux session named mysession.


๐Ÿ” Reattach to a Session

List all available sessions:

1
tmux ls

Attach to the most recent session:

1
tmux attach

Attach to a specific session:

1
tmux attach -t mysession

โŒจ๏ธ Common Keybindings

Press Ctrl + b first, then:

Key Action
d Detach from session
c Create a new window
n Next window
" Split pane horizontally
% Split pane vertically
x Close the current pane
[ Enter scrollback mode
: Open command prompt

๐Ÿงน Exit a Session

Kill a specific tmux session:

1
tmux kill-session -t mysession

Or exit from inside tmux:

1
exit

๐Ÿ”ง Useful Aliases (.bashrc or .zshrc)

1
2
3
alias ta="tmux attach"
alias tn="tmux new -s"
alias tls="tmux ls"
Pro tip
Tmux is perfect for long-running processes on servers. Detach with Ctrl + b, then d, log out, and come back later!