Cheat Sheets, Resources

Tmux Cheat Sheet

Introduction

Tmux is an open-source 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, allowing remote sessions to remain active without being visible.

Cheat Sheet

Tmux comes with a lot of built-in commands, although these are the main ones I use while performing day-to-day operation:

CommandDescription
tmux ls/tmux list-sessionsList open sessions
tmux/tmux new-sessionStart a new session
tmux new -s stefStart a new session and call it stef
tmux kill-session -t stefKill the stef session
tmux attach-session -t stefAttach o the stef session
[CTRL+B] + $Rename current session
[CTRL+B] + dDetach from current session
[CTRL+B] + cCreate new windows
[CTRL+B] + ,Rename current window
[CTRL+B] + 0-9Switch to a different window
[CTRL+B] + &Close current window
[CTRL+B] + %Split pane vertically
[CTRL+B] + “Split pane horizontally
[CTRL+B] + ↑↓→←Switch to a different pane based on direction
[CTRL+B] + CTRL + ↑↓→←Resize width/height of current pane
[CTRL+B] + xClose current pane
[CTRL+B] + [Enter copy mode (used to scroll up/down)
/ (while in copy mode)Search forward
? (while in copy mode)Search backward
n (while in copy mode)Jump to next occurrence (while searching)
N (while in copy mode)Jump to previous occurrence

Conclusion

Tmux is a phenomenal that can help massively improve productivity by allowing to have any number of split panes, windows and sessions that can allow to run several tasks simultaneously.

It is also a lot more configurable than a normally terminal and it has really useful functionalities like the ability to log every command automatically to a log file.