NIX ^: Linux & IT

tmux

tmux sessions, windows, panes, copy mode and config bindings for terminal multiplexing.

beginner updated 2026-08-09 tmux

tmux

Prefix Key: Ctrl+a (changed from the default Ctrl+b)

Note — This sheet documents a customized tmux config (remapped prefix, vim-style pane nav, and several TPM plugins). Bindings marked as plugin features assume those plugins are installed.

Getting Started

CommandAction
tmux new -s nameCreate new session with name
tmux lsList all sessions
tmux a -t nameAttach to existing session
tmux kill-session -t nameKill specific session
tmux kill-serverKill all tmux sessions

Session Management

KeybindAction
Ctrl+a then dDetach from current session
Ctrl+a then $Rename current session
Ctrl+a then (Switch to previous session
Ctrl+a then )Switch to next session
Ctrl+a then sList all sessions (interactive)
Ctrl+a then Shift+sSave session (resurrect)
Ctrl+a then Shift+rRestore session (resurrect)

Sessions auto-save every 15 minutes (tmux-continuum).

Window Management (Tabs)

KeybindAction
Ctrl+a then cCreate new window
Ctrl+a then ,Rename current window
Ctrl+a then nNext window
Ctrl+a then pPrevious window
Ctrl+a then 0-9Jump to window number
Alt+1 .. Alt+5Quick jump to window 1-5 (no prefix needed)
Ctrl+a then wList all windows (interactive)
Ctrl+a then &Kill current window
Ctrl+a then fFind window by name
Ctrl+a then lLast active window

Pane Management (Splits)

Creating Panes

KeybindAction
Ctrl+a then |Split pane horizontally (side by side)
Ctrl+a then -Split pane vertically (top/bottom)
KeybindAction
Ctrl+a then h/j/k/lMove to left/bottom/top/right pane
Ctrl+h/j/k/lMove between panes (no prefix, vim-aware)
Alt+Left/Down/Up/RightMove between panes (no prefix)

Resizing Panes

KeybindAction
Ctrl+a then Shift+hResize pane left by 5 cells
Ctrl+a then Shift+jResize pane down by 5 cells
Ctrl+a then Shift+kResize pane up by 5 cells
Ctrl+a then Shift+lResize pane right by 5 cells

Pane Layouts

KeybindAction
Ctrl+a then Shift+eEven horizontal layout
Ctrl+a then Shift+vEven vertical layout
Ctrl+a then Shift+tTiled layout
Ctrl+a then SpaceCycle through all layouts

Other Pane Actions

KeybindAction
Ctrl+a then zToggle pane zoom (fullscreen)
Ctrl+a then xKill current pane
Ctrl+a then !Break pane into new window
Ctrl+a then {Move pane left
Ctrl+a then }Move pane right
Ctrl+a then Ctrl+oRotate panes clockwise
Ctrl+a then Shift+sSynchronize panes (type in all at once)
Ctrl+a then qShow pane numbers

Copy Mode (Vim-Style)

Entering/Exiting

KeybindAction
Ctrl+a then [Enter copy mode
qExit copy mode
EscExit copy mode
KeybindAction
h/j/k/lMove left/down/up/right
wMove forward by word
bMove backward by word
gGo to top of buffer
Shift+gGo to bottom of buffer
Ctrl+uPage up
Ctrl+dPage down

Selection & Copying

KeybindAction
vStart selection (visual mode)
Shift+vSelect entire line
yCopy selection and exit copy mode
rToggle rectangle selection
Ctrl+a then Shift+pPaste buffer
Ctrl+a then ]Paste buffer (alternative)

Searching in Copy Mode

KeybindAction
/Search forward
?Search backward
nNext search result
Shift+nPrevious search result

Smart Search (Copycat Plugin)

KeybindAction
Ctrl+a then Ctrl+iSearch for IP addresses
Ctrl+a then Ctrl+uSearch for URLs
Ctrl+a then Ctrl+fSearch for file paths
Ctrl+a then Ctrl+hSearch for hashes (SHA, MD5)
Ctrl+a then Ctrl+dSearch for digits
n / Shift+nNext / previous match
EnterCopy selection

Text Extraction (Extrakto Plugin)

KeybindAction
Ctrl+a then TabOpen extrakto (extract all text)
TabToggle filter mode (in extrakto)
Ctrl+j or DownNavigate down results
Ctrl+k or UpNavigate up results
EnterCopy selection to clipboard
Ctrl+oOpen selection in editor
EscCancel/exit

Logging & Recording

KeybindAction
Ctrl+a then Shift+lToggle logging (start/stop recording)
Ctrl+a then Ctrl+sScreenshot pane (save visible content)
Ctrl+a then Ctrl+pSave complete history (all scrollback)

Logs saved to ~/tmux-logs/. Filename format: tmux-sessionname-window-pane-20260131_120000.log

Quick Copy (Fingers Plugin)

KeybindAction
Ctrl+a then Shift+fShow copy hints on screen
Type the hintCopy text at that location
EnterCopy main match
TabToggle hint mode
EscCancel

Fuzzy Finder (tmux-fzf Plugin)

KeybindAction
Ctrl+a then Ctrl+fOpen fuzzy finder menu
Ctrl+j or DownNavigate down
Ctrl+k or UpNavigate up
EnterSelect item
EscCancel

File Sidebar (Sidebar Plugin)

KeybindAction
Ctrl+a then TabToggle file tree sidebar
Ctrl+a then BackspaceToggle sidebar and focus it
EnterOpen file (when in sidebar)
qClose sidebar

Open URLs/Files (Open Plugin)

In copy mode:

KeybindAction
oOpen highlighted URL or file
Ctrl+oOpen highlighted text in $EDITOR
Shift+sWeb search highlighted text

Pentesting Tools (Custom Bindings)

KeybindAction
Ctrl+a then Shift+yOpen Python window
Ctrl+a then Shift+nOpen Nmap window
Ctrl+a then Shift+mOpen Metasploit window
Ctrl+a then Shift+bOpen Burp Suite window
Ctrl+a then Shift+gOpen Gobuster window

System & Configuration

KeybindAction
Ctrl+a then rReload tmux config
Ctrl+a then ?Show all key bindings
Ctrl+a then :Enter tmux command mode
Ctrl+a then tShow clock
Ctrl+a then bToggle status bar on/off
Ctrl+a then Ctrl+kClear scrollback buffer
Ctrl+a then iShow tmux info

Plugin Management (TPM)

KeybindAction
Ctrl+a then Shift+iInstall plugins
Ctrl+a then Shift+uUpdate plugins
Ctrl+a then Alt+uUninstall unused plugins

Common Workflows

Pentesting Setup

1. tmux new -s htb-box
2. Ctrl+a then |        (split right)
3. Ctrl+a then -        (split bottom)
4. Ctrl+a then Shift+n  (open Nmap window)
5. Ctrl+a then Shift+l  (start logging)

Finding IPs in Scan Output

1. Run: nmap -sV 10.10.10.0/24
2. Ctrl+a then Ctrl+i   (search for IPs)
3. n                    (cycle through results)
4. Enter                (copy to clipboard)

Parallel Commands

1. Ctrl+a then |        (split panes 4 ways)
2. Ctrl+a then -
3. Ctrl+a then h
4. Ctrl+a then -
5. Ctrl+a then Shift+s  (synchronize panes)
6. ssh user@host1       (types in ALL panes)
7. Ctrl+a then Shift+s  (unsynchronize)

Extract All IPs/URLs

1. Ctrl+a then Tab      (extrakto)
2. Type to filter
3. Enter to copy

Session Persistence

# Start work
tmux new -s work

# Work crashes or you disconnect...

# Restore everything
tmux a -s work
# Or if session was killed: Ctrl+a then Shift+r (restore last session)

Mouse Support

Enabled. You can click to select panes, click windows in the status bar, scroll to navigate history, drag to resize panes, and drag to select text (auto-copies).

Pro Tips

  1. Always name your sessions: tmux new -s project-name
  2. Detach, never close: Ctrl+a then d (session keeps running)
  3. Start logging for reports: Ctrl+a then Shift+l
  4. Find IPs instantly: Ctrl+a then Ctrl+i
  5. Extract anything: Ctrl+a then Tab
  6. Synchronize for parallel work: Ctrl+a then Shift+s
  7. Sessions survive SSH disconnects
  8. Zoom pane for focus: Ctrl+a then z
  9. Quick window access: Alt+1 through Alt+5

Emergency Commands

CommandAction
tmux kill-serverKill ALL tmux sessions
Ctrl+a then :kill-sessionKill current session
Ctrl+a then Ctrl+kClear screen/history
tmux aAttach to last session
Ctrl+a then ?Show all bindings if confused