DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Cheat Sheet
Tmux tips and tricks.

Install

1
apt update
2
apt install tmux
Copied!

Sessions

Create new

1
tmux new -s my-session
Copied!

Use existing session

1
tmux new -A -s my-session
Copied!
Or you can list all sessions:
1
tmux ls
Copied!
And attache to an existing one:
1
tmux attach-session -t my-session
Copied!

Delete/Kill session

Kill all sessions

1
tmux kill-server
Copied!

Kill specific session

1
tmux kill-session -t my-session
Copied!

Kill other sessions

If you are inside a tmux session you would like to keep and kill all others, run:
1
tmux kill-session -a
Copied!

Windows and Panes

  • Ctrl+b c Create a new window (with shell)
  • Ctrl+b w Choose window from a list
  • Ctrl+b 0 Switch to window 0 (by number )
  • Ctrl+b , Rename the current window
  • Ctrl+b % Split current pane vertically into two panes
  • Ctrl+b " Split current pane horizontally into two panes
  • Ctrl+b o Go to the next pane
  • Ctrl+b ; Toggle between the current and previous pane
  • Ctrl+b x Close the current pane
  • Enable synchronize-panes: ctrl+b then shift :. Then type set synchronize-panes on at the prompt. To disable synchronization: set synchronize-panes off.
  • Ctrl+b [ To enable copy mode. Use arrows to scroll.
  • Ctrl+b Alt + 1 All panels on vertical with same width.
    • Or run Ctrl+b Shift + : select-layout even-vertical
  • Ctrl+b Alt + 2 All panels on horizontal with same height.
    • Or run Ctrl+b Shift + : select-layout even-horizontal