Tmux CLI
New session {.row-span-2}
Start a new session
$ tmuxStart a new named session
$ tmux new -s mynameShow all sessions
$ tmux lsAttach session
Attach to last session
$ tmux aAttach to named
$ tmux a -t mynameKill session {.row-span-2}
Kill a session by name
$ tmux kill-ses -t mynameKill sessions but the current
$ tmux kill-ses -aKill sessions but 'myname'
$ tmux kill-ses -a -t mynameTmux help
$ tmux infoConfig
Reload config
$ tmux source-file ~/.tmux.confShow config
$ tmux show-options -gCopy Mode
| Command | Description | 
|---|---|
| Ctrl+b[ | Enter copy mode | 
| <Space> | Start selection | 
| Enter | Copy selection | 
| q | Quit copy mode | 
| Ctrl+b] | Paste contents of buffer_0 | 
| {.shortcuts} | 
Mainly works like selecting text in Vim
Tmux shortcuts
Getting started {.secondary}
| Shortcuts | Description | 
|---|---|
| Ctrl+b? | List all shortcuts | 
| {.shortcuts .show-header} | 
Show every session, window, pane, etc.
$ tmux infoPanes (Splits) {.row-span-2}
| Shortcuts | Description | 
|---|---|
| Ctrl+b"/% | Split Horiz/Vert | 
| Ctrl+b! | Pane -> Window | 
| Ctrl+bx | Kill pane | 
| Ctrl+b<Arrow> | Navigate panes | 
| Ctrl+b<Space> | Toggle layouts | 
| Ctrl+b{/} | Move to Left/Right | 
| Ctrl+bo | Go to next panes | 
| Ctrl+bz | Toggle full-screen | 
| Ctrl+b; | Toggle Last pane | 
| Ctrl+bq | Show numbers | 
| Ctrl+bq0...9 | Go to # pane | 
| {.shortcuts} | 
Window (Tabs) {.row-span-2}
| - | - | 
|---|---|
| Ctrl+bc | Create window | 
| Ctrl+bp/n | Previous/Next window | 
| Ctrl+b"/% | Split Horiz/Vert | 
| Ctrl+bw | List window | 
| Ctrl+b, | Rename window | 
| Ctrl+bf | Find window | 
| Ctrl+bl | Last window | 
| Ctrl+b. | Move window | 
| Ctrl+b& | Close window | 
| Ctrl+b0...9 | Go to # window | 
| {.shortcuts} | 
Session (Set of Windows)
| - | - | 
|---|---|
| Ctrl+bd | |
| Ctrl+bs | Show all sessions | 
| Ctrl+b$ | Rename session | 
| Ctrl+b(/) | Previous/Next session | 
| {.shortcuts} | 
Tmux Command Mode
Usage {.secondary}
| Command | Description | 
|---|---|
| Ctrl+b: | Enter command mode | 
| {.shortcuts} | 
Resizing
| Command | Description | 
|---|---|
| resize-pane -D 20 | Resize down | 
| resize-pane -U 20 | Resize up | 
| resize-pane -L 20 | Resize left | 
| resize-pane -R 20 | Resize right | 
Listing
| Command | Description | 
|---|---|
| list-keys | All commands | 
| list-panes | All panes | 
| list-windows | All Windows | 
Copying
| Command | Description | 
|---|---|
| list-buffers | List all buffers | 
| show-buffer | Show #0 contents | 
| capture-pane | Copy of pane | 
| choose-buffer | Show and paste | 
| save-buffer a.txt | Save to file | 
| delete-buffer -b 1 | Delete buffer 1 | 
Setting
| Command | Description | 
|---|---|
| set -g OPTION | Set for all sessions | 
| setw -g OPTION | Set for all windows | 
| setw -g mode-keys vi | Enable vi-mode | 
| set -g prefix C-a | Set prefix | 
Misc
| Command | Description | 
|---|---|
| swap-pane -s 3 -t 1 | Swap pane | 
| swap-window -t -1 | Move to left | 
| setw synchronize-panes | Sync Panes | 
| join-pane -t :# | Join pane |