Tmux is a tool that helps you manage multiple terminal windows. Think of it like a magic box for your computer’s command line. You can split screens, run tasks in the background, and never lose work if the internet drops. It’s perfect for coders, sysadmins, or anyone who loves the terminal.
Ready to try tmux? Let’s install it first!
How to Install tmux (3 Easy Ways)
1. For Linux Users
Open your terminal (Ctrl+Alt+T). Type:
sudo apt-get install tmux
Hit Enter. Type your password if asked. Done!
2. For macOS Users
Install Homebrew first. Open Terminal and paste:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, install tmux:
brew install tmux
3. For Windows Users
Use Windows Subsystem for Linux (WSL). Install Ubuntu from the Microsoft Store. Open Ubuntu and run:
sudo apt-get install tmux
How to Use tmux (Basics)
Start a new tmux session:
tmux new -s mysession
Split Your Screen
- Vertical split:
Ctrl+b
then%
- Horizontal split:
Ctrl+b
then"
Switch Panes
Press Ctrl+b
+ arrow keys (←→↑↓).
Detach from Session
Press Ctrl+b
then d
. Your work stays running!
Re-enter a Session
Type tmux attach -t mysession
.
Read Also: Gobuster Tutorial
tmux Cheat Sheet
Shortcut | Action |
---|---|
Ctrl+b c | Create new window |
Ctrl+b n | Next window |
Ctrl+b p | Previous window |
Ctrl+b & | Close window |
Ctrl+b , | Rename window |
How to Delete tmux Sessions
- List all sessions:
tmux ls
- Kill a session:
tmux kill-session -t mysession
How to Uninstall tmux
Linux/macOS/WSL
- Linux/WSL:
sudo apt-get remove tmux
- macOS:
brew uninstall tmux
Windows
Uninstall Ubuntu via Settings > Apps.
5 Tips to Master tmux
- Use mouse mode: Add
set -g mouse on
to~/.tmux.conf
. - Customize shortcuts.
- Save sessions with plugins like tmux-resurrect.
- Practice daily!
- Join the tmux GitHub community for updates.
FAQs
Q1. Is tmux free?
Yes! Tmux is open-source and free for everyone.
Q2. Can tmux crash?
Rarely. If it does, reconnect with tmux attach
.
Q3. Does tmux work on Android?
Yes! Use Termux app and install tmux there.
Final Words
Tmux makes terminal work fun and easy. Install it today, try the shortcuts, and share this guide with friends! Got questions? Drop a comment below. Happy coding! 🚀