Linux Terminal Command: tmux

The tmux command is an essential tool in Process & Job Control. In this tutorial, we will explore what tmux does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.


Concept & Explanation

The tmux command allows you to manage multiple terminal panes and tabs inside a single window, persisting sessions across SSH disconnects.


Common Options & Syntax

tmux [options] [arguments]

Here are the most common flags used with tmux:


1. Interactive Example (Simple)

Here is how most people run the command:

# Example
tmux

What it does: Launches a new tmux session.


2. Power-User Example (Advanced)

For scripting and advanced diagnostics, use this configuration:

# Advanced
tmux new -s dev -n editor

What it does: Creates a new tmux session named ‘dev’ and names the initial tab window ’editor’.


⚙️ Warning & Common Pitfalls

[!WARNING] Inside tmux, the default command prefix key is Ctrl+b. To detach from a session, press Ctrl+b followed by d.


Here are some related posts on cli_tty1 you might want to check out: