tmux cheatsheet

Let's use tmux!

Reference: tmux shotcuts & cheatsheetarrow-up-right

What is tmux?

tmux

  • Terminal Multiplexer

  • Allows you to split a single terminal to run multiple programs, and switch running programs to background mode and back

tmux can help resolve the following difficulties encountered when using a Linux shell:

  1. SSH Client shell session timeout

  2. Wanting to use one SSH connection across multiple shells

  3. Switching between shell windows is cumbersome

  4. Wanting previous work to remain when you close and reopen the shell

Key features

  • Allows using multiple windows and panes in a single terminal window

  • Keeps windows and panes maintained in a session

    • Sessions can persist even if the Internet disconnects!

  • Sessions can be shared

Sessions, Windows, and Panes

Sessions

  • The basic unit for running tmux

  • Composed of multiple windows

  • Can be thought of as creating a single virtualized console

Windows

  • A terminal screen

  • Can be used like tabs within a session

Panes

  • Screen splits within a single window

Essential tmux commands

start new session:

start new with session name:

attach:

attach to named:

list sessions:

exit tmux:

kill session:

Kill all the tmux sessions:

Prefix & Shortcuts

Prefix

  • If no separate settings are configured in .tmux.conf, the default prefix is ctrl + b

  • Combine the prefix with the commands below to use them

Changing the prefix

Open the ~/.tmux.conf file at the $HOME path with vi editor

Content to add to .tmux.conf:

Apply the modified .tmux.conf:

Sessions

Windows (tabs)

Panes (splits)

Misc

Last updated