Skip to content

Instantly share code, notes, and snippets.

@audreyfeldroy
Created September 3, 2024 09:31
Show Gist options
  • Save audreyfeldroy/95933185dba74321f1dea8e477976f13 to your computer and use it in GitHub Desktop.
Save audreyfeldroy/95933185dba74321f1dea8e477976f13 to your computer and use it in GitHub Desktop.
Ultimate tmux Cheat Sheet

Ultimate tmux Cheat Sheet

Table of Contents

  1. Session Management
  2. Window Management
  3. Pane Management
  4. Navigation
  5. Miscellaneous
  6. Customization
  7. Common Use Cases
  8. Troubleshooting

Session Management

Command Description
tmux Start a new session
tmux new -s session_name Start a new named session
tmux ls List all sessions
tmux attach Attach to the last session
tmux attach -t session_name Attach to a specific named session
Ctrl-b d Detach from the current session
tmux kill-session -t session_name Kill a specific session

Window Management

Command Description
Ctrl-b c Create a new window
Ctrl-b n Move to the next window
Ctrl-b p Move to the previous window
Ctrl-b 0-9 Switch to window by number
Ctrl-b , Rename the current window
Ctrl-b & Close the current window

Pane Management

Command Description
Ctrl-b " Split pane horizontally
Ctrl-b % Split pane vertically
Ctrl-b o Switch to the next pane
Ctrl-b q 0-9 Switch to a specific pane by number
Ctrl-b Space Toggle between pane layouts
Ctrl-b z Zoom/unzoom the current pane
Ctrl-b x Close the current pane

Navigation

Command Description
Ctrl-b [ Enter scroll mode
q Exit scroll mode
/ Search in scroll mode

Miscellaneous

Command Description
Ctrl-b ? List all keybindings
Ctrl-b : Enter command mode
:setw synchronize-panes Toggle synchronized panes

Customization

  • Config file location: ~/.tmux.conf
  • Reload config: tmux source-file ~/.tmux.conf

Common Use Cases

Remote Session Management

  1. Start a new session on a remote server:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment