Some Basic Tmux Commands

Tmux is a command-line tool which lets you run and manage multiple programs in one single terminal, and is commonly used on remote machines accessed via SSH.

You may find this tool particularly useful when you need to deal with, and keep an eye on, time-consuming processes that you run on a remote server.

Simply put, tmux allows you to reattach running programs to another terminal after logging off from an SSH session.

In a typical workflow, you create a tmux session or attach to an existing one. Within a session, you manage multiple windows which are basically virtual terminals where you run programs.

Tmux Sessions

Create a session.

tmux

List active sessions.

tmux ls

Attach to a session.

tmux attach -t <target-session>

Windows

Keyboard Shortcut Result
CTRL+b, then d Detach from current session.
CTRL+b, then c Create a new window.
CTRL+b, then n Switch to the next window.
CTRL+b, then p Switch to the previous window.

Close a window.

exit

© 2024 Massimo Nazaria

RSS

Licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.