Introduction
In the world of command-line tools, efficiency and multitasking are paramount. That’s where TMUX, a terminal multiplexer, excels. It allows users to launch multiple terminal windows and switch easily between them, detach them (to keep them running in background), broadcast commands to multiple terminals and much more. This guide aims to introduce TMUX to beginners, providing a comprehensive start to mastering this powerful tool. While initially challenging, practice reveals the ease and speed of shortcuts over mouse clicks, enhancing productivity.
What is TMUX?
TMUX stands for Terminal Multiplexer. It’s a handy tool for users who work extensively with the command line. It allows multiple terminal sessions to be accessed and controlled from a single screen. TMUX can be especially useful for remote work, long-running processes, and managing multiple tasks efficiently.
TMUX combines the functionalities of tools like the Linux screen and Terminator Terminal Emulator, among others, into a single, powerful tool.
Installing TMUX
TMUX is available on most Unix-like operating systems. To install TMUX, use the package manager of your Linux distribution. For example, on Ubuntu or Debian systems, you can install TMUX using:
sudo apt-get install tmux
For Red Hat/CentOS systems, use:
sudo yum install tmux
For macOS, use:
brew install tmux
Windows users can use TMUX with Windows Subsystem for Linux (WSL) or with Cygwin.
Basic Commands
- Starting TMUX: Simply type
tmuxin your terminal to start a new session. - Creating New Windows: Once inside a TMUX session, you can create a new window by pressing
Ctrl + b, then". (Note: Use the Shift key to press"). - Switching Between Windows: To navigate between windows, press
Ctrl + b, then use the arrow keys (↑,↓,←,→). - Splitting Windows: You can split windows into panes. For a vertical split, press
Ctrl+bfollowed by%. For a horizontal split, useCtrl+bfollowed by". (Note: Use the Shift key to press"). - Detaching and Attaching Sessions: To detach from a session, press
Ctrl+bfollowed byd. To reattach, usetmux attach-session -t [session-name]. - Broadcast Commands: To broadcast a command to multiple windows, press
Ctrl+bfollowed by:then type the followingsetw synchronize-panes on, then press Enter.
Advanced Features
- Session Management: TMUX allows you to manage multiple sessions. This is useful if you want to organize your tasks in separate workspaces.
- Window & Pane Layouts: TMUX offers several layouts for your panes, which can be adjusted to fit your workflow.
- Scripting with TMUX: TMUX can be scripted, allowing for automation of tasks and even more powerful usage.
TMUX Shortcuts
| Action | Key |
|---|---|
| Start TMUX | tmux |
| Start a named session | tmux new -s <session_name> |
| List TMUX sessions | tmux ls |
| New Window | Cmd+b, c |
| Switch Window | Cmd+b, window number |
| Split Window (Vertical) | Cmd+b, % |
| Split Window (Horizontal) | Cmd+b, " |
| Detach Session | Cmd+b, d |
| Attach Session | tmux attach-session -t [session-name] |
| Toggle pane zoom | Cmd+b, z |
For a comprehensive list I would like to mention this PDF
https://comtronic.com.au/blog/wp-content/uploads/comtronic_cheatsheet_tmux_A4.pdf
Pro Tip:
To enable the ability to use the Up arrow key – or Pageup key – for scrolling within a TMUX session, you need to enter Copy Mode. Copy Mode allows you to navigate through the buffer that holds the data for the current window. You can enter Copy Mode by pressing Ctrl+b followed by "[” key. To deactivate Copy Mode just press Ctrl+ c
Very important is to understand the difference between a window and a pane. Windows are like new tabs in a browser while pane is created when a window is split.
Conclusion
TMUX is an incredibly powerful tool for anyone who spends a lot of time in the command line. Its ability to manage multiple tasks, detach and reattach sessions, and customize to fit your needs makes it indispensable for efficient command-line work. As a Senior VoIP Engineer, mastering TMUX can significantly enhance your productivity, especially when managing remote servers or multitasking between different command-line applications.
Happy Multiplexing!
Akash Gupta
Senior VoIP Engineer and AI Enthusiast

AI and VoIP Blog
Thank you for visiting the Blog. Hit the subscribe button to receive the next post right in your inbox. If you find this article helpful don't forget to share your feedback in the comments and hit the like button. This will helps in knowing what topics resonate with you, allowing me to create more that keeps you informed.
Thank you for reading, and stay tuned for more insights and guides!

Leave a Reply