10 Essential Tmux Commands for Boosting Terminal Productivity

Essential Tmux Commands for Beginners

If you spend any time in the terminal, you have probably run into the problem of wanting to run two things at once. Maybe you are editing a config file and need to check a log at the same time. Or you SSH into a server and want to keep a process running after you disconnect. Tmux solves both problems. It is a terminal multiplexer, which is a fancy way of saying it lets you split your terminal into multiple panels and keeps your sessions alive even when you close the connection.

I avoided tmux for years. I thought it was too much to learn for something I could handle with multiple terminal windows. Then I tried it and switched in about an hour. The tmux commands you need to get started are surprisingly simple. You do not need to memorize everything at once. Just learn the basics, and the rest will come naturally as you use it daily.

10 Practical Tmux Commands You Need to Know

Below are the tmux commands that I use every single day. Start with the first few, and add more as you go.

1. Starting a Tmux Session

The most basic tmux command is tmux new -s session_name. This creates a named session. I recommend always naming your sessions. Without a name, tmux assigns a number, and finding the right session later becomes guesswork. Use something descriptive like tmux new -s server-config or tmux new -s dev.

2. Detaching and Reattaching

This is the feature that makes tmux indispensable. Press Ctrl+b d to detach from a session. Your programs keep running. Logs keep writing. Processes keep executing. Later, run tmux attach -t session_name to pick up exactly where you left off. These two tmux commands alone are worth the setup time.

3. Splitting Panes

To split your window horizontally, press Ctrl+b ". For a vertical split, use Ctrl+b %. I use vertical splits constantly. One pane for editing code and another for running tests. Or one pane watching logs and another running commands. These tmux commands turn a single terminal into a full workspace.

4. Navigating Between Panes

Once you have multiple panes, you need to move between them. Press Ctrl+b arrow_key to jump to the pane in that direction. If you have four panes open, you can move between them quickly without touching your mouse. I mapped mine to Ctrl+h/j/k/l like vim, but the defaults work fine. Mastering navigation tmux commands is what makes the tool feel fast.

5. Creating and Switching Windows

Think of windows like browser tabs for your terminal. Press Ctrl+b c to create a new window. Use Ctrl+b p and Ctrl+b n to go to the previous or next window. Or jump directly with Ctrl+b [0-9]. I keep a window for editing, one for running the server, and one for git operations. These tmux commands keep your work organized without cluttering your screen with panes.

6. Scrolling Through Output

By default, tmux does not let you scroll with the mouse wheel. Enter copy mode with Ctrl+b [. Now you can scroll with the arrow keys, Page Up, and Page Down. Press q to exit. This is one of those tmux commands that trips up beginners because they expect the mouse to work. Once you get used to copy mode, scrolling feels faster than reaching for the mouse.

7. Listing All Sessions

Run tmux ls to see every active session. If you are like me and leave sessions running for days, this command becomes essential. It shows session names, window counts, and whether the session is attached. Pair it with tmux attach -t name to jump into any session quickly.

8. Killing Panes and Windows

Press Ctrl+b x to kill the current pane. Tmux will ask you to confirm with y. To kill the entire session, run tmux kill-session -t name from outside tmux. Knowing these cleanup tmux commands prevents zombie sessions from piling up.

9. Renaming Windows

By default, tmux names windows after the running program. That is not always useful. Press Ctrl+b , to rename the current window. I rename windows to match the task: “config”, “logs”, “deploy”. This is a small habit that makes navigating busy sessions much easier.

10. Chaining Commands for Faster Workflows

Once you have the basics down, you can chain tmux commands for real speed. For example, tmux new -s work \; split-window -h \; send-keys 'htop' Enter creates a new session, splits it, and starts htop in the right pane. You can script your entire workspace setup this way.

I keep a shell alias for my daily session: alias mux="tmux new -s main". One command and I am in my workspace with all my tools ready.

Customizing Tmux

Tmux reads a config file at ~/.tmux.conf. Here is a minimal config I use to make things more comfortable:

set -g mouse on
set -g default-terminal "screen-256color"
set -g history-limit 50000
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"

The mouse option lets you click between panes and scroll naturally. The history limit gives you 50000 lines of scrollback. The last line lets you reload config changes with Ctrl+b r instead of restarting tmux.

If you want to go deeper, check out the official tmux GitHub repository for the latest updates. The tmux man page documents every option and key binding. For a more visual guide, tmuxcheatsheet.com has a printable cheat sheet.

For more Linux terminal tools, check out our guides on fzf for fuzzy searching and zoxide for faster directory navigation. Both tools pair well with tmux for a fully optimized terminal workflow. You might also like our btop monitoring guide for a real-time system view inside a tmux pane.

Boosting Productivity with Tmux Commands

The real power of tmux commands is not any single feature. It is how they work together. Start a session. Split a pane for monitoring. Detach and go home. Reattach in the morning and everything is still there. Your SSH connections do not drop your work anymore. Your long-running scripts survive network interruptions.

If you have been putting off learning tmux, start today. Install it with sudo apt install tmux on Debian or Ubuntu, or brew install tmux on macOS. Run tmux new -s test and practice the basic tmux commands listed above. You will be faster in the terminal by the end of the day.

Tmux is one of those tools that looks complex from the outside but becomes invisible once you use it. The tmux commands are simple, the benefits are immediate, and the productivity gains add up fast. Give it a shot.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts