Fundamentals 8 min read

Master tmux: Essential Commands and Keyboard Shortcuts for Linux

This guide explains how to use tmux on Linux—including creating, detaching, attaching, renaming, and killing sessions, managing windows and panes with handy keyboard shortcuts—plus a quick tip for identifying physical network interfaces using ethtool.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master tmux: Essential Commands and Keyboard Shortcuts for Linux

tmux (terminal multiplexer) is a powerful tool on Linux that lets you manage multiple terminal sessions within a single screen. It supports creating, detaching, attaching, renaming, and killing sessions, as well as managing windows and panes.

Session Commands

tmux new -s <session_name>

– create a new session. tmux detach -s <session_name> – detach a session (or press Ctrl+d inside the session). tmux ls or tmux list-sessions – list existing sessions. tmux attach -t <session_name> – re‑attach to a session. tmux kill-session -t <session_name> – terminate a session. tmux switch -t <session_name> or tmux switch -t <session_id> – switch between sessions. tmux rename-session -t <old_id> <new_name> – rename a session.

Window Operations

tmux new-window

– create a new window in the current session. tmux new-window -n <window_name> – create and name a new window. tmux select-window -t <N> – switch to window number N. tmux select-window -t <window_name> – switch to a named window. tmux rename-window <new_name> – rename the current window. tmux kill-window -t <target> – close a window (by number or name).

Window Keyboard Shortcuts (prefix Ctrl+b )

Ctrl+b c

– create a new window. Ctrl+b & – close the current window. Ctrl+b p – go to the previous window. Ctrl+b n – go to the next window. Ctrl+b l – toggle between the last two windows. Ctrl+b w – list windows for selection. Ctrl+b , – rename the current window. Ctrl+b q – show window numbers.

Pane (Panel) Operations

tmux split-window

– split the current pane horizontally (top/bottom). tmux split-window -h – split the current pane vertically (left/right). tmux kill-pane – close the current pane. tmux select-pane -U – move focus up. tmux select-pane -D – move focus down. tmux select-pane -L – move focus left. tmux select-pane -R – move focus right. tmux swap-pane -U – move the current pane up. tmux swap-pane -D – move the current pane down.

Pane Keyboard Shortcuts (prefix Ctrl+b )

Ctrl+b %

– split vertically. Ctrl+b " – split horizontally. Ctrl+b x – close the current pane. Ctrl+b ; – switch to the previous pane. Ctrl+b o – switch to the next pane. Ctrl+b { – move pane left. Ctrl+b } – move pane right. Ctrl+b z – toggle pane fullscreen. Ctrl+b q – display pane numbers.

Linux Network Interface Identification

If you have multiple NICs and need to know which physical port corresponds to eth0, eth1, etc., use: ethtool -p eth0 The command makes the physical port’s LED flash, allowing you to match the interface name to the hardware. Install ethtool via your package manager if it is missing.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxSession Managementkeyboard shortcutsterminaltmuxpanenetwork interface
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.