0% found this document useful (0 votes)
63 views6 pages

Tmux Cheatsheet

This document provides a cheatsheet of commands for tmux, a terminal multiplexer that allows multiple terminal sessions to be accessed and controlled from a single terminal. It lists commands for creating and managing tmux sessions and windows, splitting panes within windows, and moving between sessions, windows, and panes. Keyboard shortcuts are provided for most commands to control and interact with sessions, windows, and panes in tmux.

Uploaded by

MrKey Lord
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
63 views6 pages

Tmux Cheatsheet

This document provides a cheatsheet of commands for tmux, a terminal multiplexer that allows multiple terminal sessions to be accessed and controlled from a single terminal. It lists commands for creating and managing tmux sessions and windows, splitting panes within windows, and moving between sessions, windows, and panes. Keyboard shortcuts are provided for most commands to control and interact with sessions, windows, and panes in tmux.

Uploaded by

MrKey Lord
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 6

# Tmux Cheatsheet

## Sessions

#### Start a new session

```bash
$ tmux

$ tmux new

$ tmux new-session

Ctrl + b :new
```

#### Start a new session with the name _mysession_

```bash
$ tmux new -s mysession

Ctrl + b :new -s mysession

```

#### Kill/delete session _mysession_

```bash
$ tmux kill-ses -t mysession

$ tmux kill-session -t mysession


```

#### Kill/delete all sessions but the current

```bash
$ tmux kill-session -a
```

#### Kill/delete all sessions but _mysession_

```bash
$ tmux kill-session -a -t mysession
```

#### Rename session

```bash
Ctrl + b + $
```

#### Detach from session

```bash
Ctrl + b + d
```

#### Detach others on the session (Maximize window by detach other clients)
```bash
Ctrl + b :attach -d
```

#### Show all sessions

```bash
$ tmux ls

$ tmux list-sessions

Ctrl + b s

```

#### Attach to last session

```bash
$ tmux a

$ tmux at

$ tmux attach

$ tmux attach-session

```

#### Attach to a session with the name _mysession_

```bash
$ tmux a -t mysession

$ tmux at -t mysession

$ tmux attach -t mysession

$ tmux attach-session -t mysession

```

#### Session and Window Preview

```bash
Ctrl + b w
```

#### Move to previous session

```bash
Ctrl + b (
```

#### Move to next session

```bash
Ctrl + b )
```
## Windows

#### Start a new session with the name _mysession_ and window _mywindow_

```bash
$ tmux new -s mysession -n mywindow
```

#### Create window

```bash
Ctrl + b c
```

#### Rename current window

```bash
Ctrl + b ,
Ctrl + b :rename-window <name>
```

#### Close current window

```bash
Ctrl + b &
```

#### Previous window

```bash
Ctrl + b p
```

#### Next window

```
Ctrl + b n
```

#### Switch/select window by number

```bash
Ctrl + b 0 ... 9
```

#### Toggle last active window

```bash
Ctrl + b l
```

#### Reorder window, swap window number 2(src) and 1(dst)

```bash
Ctrl + b :swap-window -s 2 -t 1
```
#### Move current window to the left by one position

```bash
Ctrl + b :swap-window -t -1
```

## Panes

#### Check pane numbering and current active pane

```bash
Ctrl + b q
```

#### Toggle last active pane

```bash
Ctrl + b ;
```

#### Split pane with horizontal layout

```bash
Ctrl + b %
```

#### Split pane with vertical layout

```bash
Ctrl + b "
```

#### Delete current pane/terminal

```bash
Ctrl + d
Ctrl + b x
```

#### Move the current pane left

```bash
Ctrl + b {
```

#### Move the current pane right

```bash
Ctrl + b }
```

#### Switch to pane to the direction

```bash
Ctrl + b UP

Ctrl + b DOWN

Ctrl + b LEFT
Ctrl + b RIGHT
```

#### Toggle synchronize-panes(send command to all panes)

```bash
Ctrl + b :setw synchronize-panes

```

#### Toggle between pane layouts

```bash
Ctrl + b Spacebar
```

#### Switch to next pane

```bash
Ctrl + b o
```

#### Show pane numbers

```bash
Ctrl + b q
```

#### Switch/select pane by number

```bash
Ctrl + b q 0 ... 9
```

#### Toggle pane zoom

```bash
Ctrl + b z
```

#### Convert pane into a window

```bash
Ctrl + b !
```

#### Resize current pane height

```bash
Ctrl + b Ctrl + UP

Ctrl + b Ctrl + DOWN


```

#### Resize current pane width(holding second key is optional)

```bash
Ctrl + b Ctrl + LEFT
Ctrl + b Ctrl + RIGHT
```

#### Close current pane

```bash
Ctrl + b x
Ctrl + d
```

## Misc

#### Enter command mode

```bash
Ctrl + b :
```

#### Set OPTION for all sessions

```bash
Ctrl + b :set -g OPTION
```

#### Set OPTION for all windows

```bash
Ctrl + b :setw -g OPTION
```

#### Enable mouse mode

```bash
set mouse on
```

## Help

#### List key bindings (shortcuts)

```bash
$ tmux list-keys

Ctrl + b :list-keys

Ctrl + b ?
```

#### Show every session, window, pane, etc..

```bash
$ tmux info
```

You might also like