Home

Tmux command cheat sheet

tmux Sessions

tmux Windows

tmux Panes

Pane Resizing

tmux Copy Mode

tmux Miscellaneous


Step-by-Step Examples

Example 1: Basic Multi-Pane Development Setup

  1. Start new session: tmux new -s dev
  2. Split horizontally for code editor: CTRL+b then "
  3. Move to bottom pane: CTRL+b then Down Arrow
  4. Split vertically for terminal and logs: CTRL+b then %
  5. Navigate between panes: CTRL+b then arrow keys
  6. Zoom into editor pane: CTRL+b then Up ArrowCTRL+b then z

Example 2: Resizing Panes for Better Layout

  1. Create horizontal split: CTRL+b then "
  2. Top pane too small? Make it bigger: CTRL+b then CTRL+Down (repeat as needed)
  3. Bottom pane now too big? Make it smaller: CTRL+b then CTRL+Up
  4. For faster resizing: CTRL+b then ALT+Down (resizes by 5 cells)

Example 3: Managing Multiple Projects

  1. Create first project session: tmux new -s project1
  2. Work on project1, then detach: CTRL+b then d
  3. Create second project session: tmux new -s project2
  4. Switch between projects: tmux attach -t project1 or CTRL+b then s
  5. List all sessions: tmux ls

Example 4: Copy Mode Workflow

  1. Enter copy mode: CTRL+b then [
  2. Navigate to text you want: arrow keys or h/j/k/l
  3. Start selection: Spacebar
  4. Extend selection: arrow keys
  5. Copy selection: Enter
  6. Move to different pane: CTRL+b then arrow key
  7. Paste: CTRL+b then ]

Example 5: Window and Pane Navigation

  1. Create new window: CTRL+b then c
  2. Split into panes: CTRL+b then "CTRL+b then %
  3. Show pane numbers: CTRL+b then q → press 2 to jump to pane 2
  4. Switch windows: CTRL+b then 1 (for window 1)
  5. Go back to previous window: CTRL+b then p

Example 6: Advanced Pane Management

  1. Create 4-pane layout:
    • Start: CTRL+b then "
    • Top pane: CTRL+b then %
    • Bottom pane: CTRL+b then Down ArrowCTRL+b then %
  2. Resize panes for code/terminal/logs/monitoring:
    • Make code pane (top-left) larger: CTRL+b then CTRL+Right (repeat)
    • Make logs pane (bottom-right) taller: CTRL+b then CTRL+Up
  3. Swap panes if needed: CTRL+b then { or }# Tmux Command Cheat Sheet

tmux Sessions

tmux Windows

tmux Panes

Pane Resizing

tmux Copy Mode

tmux Miscellaneous


Step-by-Step Examples

Example 1: Basic Multi-Pane Development Setup

  1. Start new session: tmux new -s dev
  2. Split horizontally for code editor: CTRL+b then "
  3. Move to bottom pane: CTRL+b then Down Arrow
  4. Split vertically for terminal and logs: CTRL+b then %
  5. Navigate between panes: CTRL+b then arrow keys
  6. Zoom into editor pane: CTRL+b then Up ArrowCTRL+b then z

Example 2: Resizing Panes for Better Layout

  1. Create horizontal split: CTRL+b then "
  2. Top pane too small? Make it bigger: CTRL+b then CTRL+Down (repeat as needed)
  3. Bottom pane now too big? Make it smaller: CTRL+b then CTRL+Up
  4. For faster resizing: CTRL+b then ALT+Down (resizes by 5 cells)

Example 3: Managing Multiple Projects

  1. Create first project session: tmux new -s project1
  2. Work on project1, then detach: CTRL+b then d
  3. Create second project session: tmux new -s project2
  4. Switch between projects: tmux attach -t project1 or CTRL+b then s
  5. List all sessions: tmux ls

Example 4: Copy Mode Workflow

  1. Enter copy mode: CTRL+b then [
  2. Navigate to text you want: arrow keys or h/j/k/l
  3. Start selection: Spacebar
  4. Extend selection: arrow keys
  5. Copy selection: Enter
  6. Move to different pane: CTRL+b then arrow key
  7. Paste: CTRL+b then ]

Example 5: Window and Pane Navigation

  1. Create new window: CTRL+b then c
  2. Split into panes: CTRL+b then "CTRL+b then %
  3. Show pane numbers: CTRL+b then q → press 2 to jump to pane 2
  4. Switch windows: CTRL+b then 1 (for window 1)
  5. Go back to previous window: CTRL+b then p

Example 6: Advanced Pane Management

  1. Create 4-pane layout:
    • Start: CTRL+b then "
    • Top pane: CTRL+b then %
    • Bottom pane: CTRL+b then Down ArrowCTRL+b then %
  2. Resize panes for code/terminal/logs/monitoring:
    • Make code pane (top-left) larger: CTRL+b then CTRL+Right (repeat)
    • Make logs pane (bottom-right) taller: CTRL+b then CTRL+Up
  3. Swap panes if needed: CTRL+b then { or }
Tags: Linux, Tmux, Cheatsheet