Janik Vonrotz


2 min read

Tmux Cheat Sheet

Tmux is a terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window. It is useful for running more than one command-line program at the same time. It can also be used to detach processes from their controlling terminals, allowing SSH sessions to remain active without being visible.

Install

See https://github.com/tmux/tmux/wiki/Installing for details.

Basics

Start new session.
tmux

Show time.
ctrl + b t

Kill session.
tmux kill-session

Window

Create new window.
ctrl + b c

Rename new window.
ctrl + b ,

Close window.
ctrl + b &

Select window.
ctrl + b [0-9]

Pane

Split vertically.
ctrl + b %

Toggle last active pane.
ctrl + b ;

Split horizontally.
ctrl + b

Switch to pane to the direction.
ctrl + b [h,j,k,l]

Close current pane.
ctrl + b x

Move pane right.
ctrl + b }

Move pane left.
ctrl + b {

Convert pane into a window.
ctrl + b !

Session

Detach from session.
ctrl + b d

Attach to last session.
tmux a

Rename session.
ctrl + b $

List sessions.
ctrl + b s

Attach to named session.
tmux a -t name

Start new session.
ctrl + b :new

Copy Mode

Enter copy mode.
ctrl + b [

Navigate up and down.
ctrl + u ctrl + d

Start selection.
space

Copy selection.
enter

Paste selection.
ctrl + b ]

List buffers.
ctrl + b :list-buffer

Paste buffer selection.
choose-buffer

Save buffer.
save-buffer buf.txt

Return to normal mode.
ctrl + x

Plugins

tmux-resurrect

Save session.
ctrl + b ctrl + s

Restore session.
ctrl + b ctrl + r

Categories: Unix
Tags: tmux , cheat sheet , man page
Improve this page
Show statistic for this page