🚀 Mastering Tmux: The Ultimate Terminal Multiplexer Guide

If you often work in the terminal—especially on remote servers—Tmux can be a game-changer.
This powerful terminal multiplexer lets you run multiple sessions in a single window, split your screen into panels, and keep your work running even after disconnecting.


💡 Why Use Tmux?

Think of Tmux as a workspace manager for your terminal:

  • Persistent sessions — your processes keep running even if your SSH connection drops.
  • Multiple windows — easily switch between tasks like coding, monitoring logs, and running servers.
  • Split panes — view several terminal outputs side by side without juggling tabs.

🛠 Installing Tmux

On Ubuntu/Debian, install Tmux with:

sudo apt install tmux -y

📋 Essential Tmux Commands

Starting and Managing Sessions

tmux new -s my_session     # Create a named session
tmux attach -t my_session  # Attach to an existing session
tmux ls                    # List all sessions
tmux detach                # Detach from the current session

Common Shortcuts (Prefix: Ctrl+b)

  • % — split pane vertically
  • " — split pane horizontally
  • c — create a new window
  • n / p — move to next/previous window
  • d — detach from the current session

🪟 Working with Windows

  • Ctrl+b c — create a new window
  • Ctrl+b w — list and select a window
  • Ctrl+b 0-9 — switch to a specific window
  • Ctrl+b , — rename the current window

🖥 Managing Panes

  • Ctrl+b % — split vertically
  • Ctrl+b " — split horizontally
  • Ctrl+b arrow — move between panes
  • Ctrl+b Ctrl+arrow — resize a pane
  • Ctrl+b o — switch to the next pane
  • Ctrl+b ; — toggle between the last two panes
  • Ctrl+b x — close the current pane

📋 Clipboard in Tmux

  • Ctrl+b [ — enter copy mode
  • Ctrl+b ] — paste from buffer

⚙️ Useful Configuration (~/.tmux.conf)

set -g mouse on          # Enable mouse support
set -g history-limit 5000 # Increase scrollback history

📈 Boosting Productivity with Tmux

  • Remote work — Tmux keeps your session alive even if you lose connection.
  • Multi-tasking — monitor logs, edit files, and run servers all in one screen.
  • Custom setup — tweak your .tmux.conf for speed and convenience.

✅ Final Thoughts

Mastering Tmux can drastically improve your terminal workflow.
Once you get used to splitting panes, switching windows, and resuming sessions, you’ll never want to go back to juggling multiple SSH connections or terminal tabs.

🚀 Explore more guides on our blog 👉 blog.1it.pro
📧 Contact us: admin@1it.pro for expert IT guidance.
🌐 Explore more: Visit 1it.pro for top-tier IT solutions.

UA EN RU

Зв'язатися з нами

Telegram Email