Skip to content

Instantly share code, notes, and snippets.

@remarkablemark
Last active March 21, 2021 10:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save remarkablemark/c366603f6cf364f157a7dd67ad246f8b to your computer and use it in GitHub Desktop.
Save remarkablemark/c366603f6cf364f157a7dd67ad246f8b to your computer and use it in GitHub Desktop.
tmux cheatsheet

tmux cheatsheet

PREFIX is the prefix key (Ctrl-b is the default). ^d means Ctrl-d. ^D means Ctrl-Shift-d.

Action Command
start a new session tmux
tmux new
tmux new-session
reattach an attached/detached session tmux attach
tmux attach-session
reattach an attached session (detaching it from elsewhere) tmux attach -d
tmux attach-session -d
detach from currently attached session PREFIX d
PREFIX :detach
create new window PREFIX c
tmux new-window
exit current shell/window ^d
select window based on index PREFIX [0-9]
PREFIX :select-window -t [0-9]
rename window PREFIX ,
PREFIX :rename-window
list windows PREFIX w
go to window # PREFIX #
go to last active window PREFIX l
go to next window PREFIX n
go to previous window PREFIX p
see keybindings PREFIX ?
list sessions PREFIX s
tmux ls
tmux list-sessions
split window/pane horizontally PREFIX "
split window/pane vertically PREFIX %
switch to other pane PREFIX o
kill the current pane PREFIX x
^D
logout
cycle location of panes PREFIX ^o
swap current pane with previous PREFIX {
swap current pane with next PREFIX }
show time PREFIX t
show numeric values of panes PREFIX q
toggle zoom state of current pane (maximize/return current pane) PREFIX z
break the current pane out of its window (to form a new window) PREFIX !
rearrange current panels within same window (different layouts) PREFIX [space]
resize current pane down by a cell PREFIX :resize-pane -D
resize current pane up by a cell PREFIX :resize-pane -U
resize current pane left by a cell PREFIX :resize-pane -L
resize current pane right by a cell PREFIX :resize-pane -R
resize current pane down by 10 cells PREFIX :resize-pane -D 10
resize current pane up by 10 cells PREFIX :resize-pane -U 10
resize current pane left by 10 cells PREFIX :resize-pane -L 10
resize current pane right by 10 cells PREFIX :resize-pane -R 10
enter copy mode PREFIX [
paste copied text PREFIX ]
PREFIX ^P
reloading tmux config PREFIX :source-file ~/.tmux.conf
tmux source-file ~/.tmux.conf
kill session(s) tmux kill-session -t [id] (target)
tmux kill-session -a (all except current)
tmux kill-server (all)
kill window PREFIX &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment