Skip to content

Instantly share code, notes, and snippets.

@yalattas
Created December 22, 2025 08:18
Show Gist options
  • Select an option

  • Save yalattas/889ddc43a0d34d8cb0aeca239cc605c2 to your computer and use it in GitHub Desktop.

Select an option

Save yalattas/889ddc43a0d34d8cb0aeca239cc605c2 to your computer and use it in GitHub Desktop.
tmux

Tmux Command Cheatsheet

This is a quick reference for the most common tmux commands. Remember to press the prefix key combination (Ctrl+b by default) before pressing the command key.

Action Command (after Ctrl+b) Description
Session Management
Detach from session d Detach from the current session, leaving it running.
List sessions s Show a list of all sessions to switch between them.
Rename current session $ Give the current session a new name.
Window Management
Create a new window c Create a new window (like a new tab).
Next window n Switch to the next window.
Previous window p Switch to the previous window.
Go to a specific window 0-9 Switch to a window by its number (e.g., Ctrl+b 1).
Rename current window , Rename the current window.
Close current window & Close the current window (will ask for confirmation).
Pane Management
Split pane vertically % Split the current pane into two, side-by-side.
Split pane horizontally " Split the current pane into two, one above the other.
Switch between panes Arrow keys Move between panes using the arrow keys.
Close current pane x Close the current pane (will ask for confirmation).
Toggle pane zoom z Zoom in on the current pane to fill the window.
Swap panes o Cycle through the panes in the current window.

Attaching to Sessions (from your main terminal)

Command Description
tmux ls List all running tmux sessions.
tmux a or tmux attach Attach to the most recently used session.
tmux a -t <session_name> Attach to a specific session by its name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment