Tmux Cheat Sheet: Boost Your Terminal Productivity

Featured Image
Tmux (Terminal Multiplexer) is a powerful tool for managing multiple terminal sessions within a single window. It allows you to split windows into panes, detach sessions, and reattach them later—ideal for remote server management and multitasking.

You Should Know: Essential Tmux Commands & Configurations

1. Basic Tmux Commands

  • Start a new session:
    tmux new -s session_name 
    
  • Detach from session (keeps it running in background):
    Ctrl + b, d 
    
  • List active sessions:
    tmux ls 
    
  • Reattach to a session:
    tmux attach -t session_name 
    

2. Window & Pane Management

  • Create a new window:
    Ctrl + b, c 
    
  • Switch between windows:
    Ctrl + b, [window number] 
    
  • Split pane horizontally:
    Ctrl + b, % 
    
  • Split pane vertically:
    Ctrl + b, " 
    
  • Navigate between panes:
    Ctrl + b, [arrow key] 
    

3. Advanced Tmux Customization

Add these to `~/.tmux.conf` for better usability:

 Enable mouse support 
set -g mouse on

Set prefix to Ctrl+a (instead of Ctrl+b) 
unbind C-b 
set -g prefix C-a 
bind C-a send-prefix

Reload config without restarting 
bind r source-file ~/.tmux.conf \; display "Config reloaded!" 

4. Scripting Tmux for Automation

Launch a pre-configured session with multiple panes:

tmux new-session -d -s dev 
tmux split-window -h -t dev 
tmux send-keys -t dev:0.0 "htop" C-m 
tmux send-keys -t dev:0.1 "ncdu" C-m 
tmux attach -t dev 

What Undercode Say

Tmux is indispensable for sysadmins, developers, and cybersecurity professionals. Mastering it enhances workflow efficiency, especially when:
– Running long processes (nmap, hydra, john) without SSH disconnects.
– Monitoring logs (tail -f /var/log/auth.log) in split panes.
– Managing multiple servers via SSH in a single view.

Additional useful commands:

  • Copy mode (Ctrl + b, [) for scrolling and text selection.
  • Session locking (Ctrl + b, x) for security.
  • Synchronize panes (Ctrl + b, :setw synchronize-panes) for running commands across all panes.

For penetration testers, combine Tmux with:

tmux new -s scan_session 
tmux split-window -v 
tmux send-keys -t scan_session:0.0 "nmap -sV -A target_ip" C-m 
tmux send-keys -t scan_session:0.1 "nikto -h target_ip" C-m 

Expected Output:

A fully controlled terminal environment with persistent sessions, optimized for multitasking and remote operations.

Prediction: As CLI tools grow, Tmux will integrate more AI-driven session automation (e.g., auto-splitting panes for log monitoring).

(No irrelevant URLs or ads were included.)

References:

Reported By: Https: – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram