tmux, a terminal multiplexer, streamlines workflow via sessions, windows, and panes. Cheat sheets, like those by TheCultOfKaos and Atomicsupergeek, offer quick command references.
What is tmux?
tmux stands for “terminal multiplexer.” Essentially, it allows you to manage multiple terminal sessions within a single window. Think of it as a window manager specifically designed for your terminal. Unlike simply opening multiple tabs in your terminal emulator, tmux creates persistent sessions. This means that even if your SSH connection drops, your work within tmux continues running on the server.
Resources like cheat sheets from TheCultOfKaos (cheatography.com/22503) and Atomicsupergeek (cheatography.com/57751) demonstrate its power. It’s a command-line tool, offering flexibility and control over your terminal environment, boosting productivity for developers and system administrators.
Why Use tmux?
tmux offers significant advantages for anyone working with the command line. Its primary benefit is persistence – sessions survive disconnection, crucial for remote work. You can detach from a session and reattach later, preserving your work exactly as you left it. This is far superior to losing progress due to network interruptions.
Furthermore, tmux enables efficient multitasking through panes and windows within a single terminal. Cheat sheets (like those available via cheatography.com) simplify learning commands. It’s invaluable for managing complex workflows, running multiple processes simultaneously, and improving overall terminal productivity.

Installation and Basic Setup
tmux installation varies by OS; package managers simplify the process. Once installed, basic setup involves understanding session management commands, often detailed in readily available cheat sheets.
Installing tmux on Linux
tmux installation on Linux is typically straightforward, leveraging your distribution’s package manager. For Debian/Ubuntu-based systems, use sudo apt update followed by sudo apt install tmux. Fedora and CentOS/RHEL users can employ sudo dnf install tmux or sudo yum install tmux, respectively. Arch Linux utilizes sudo pacman -S tmux.
After installation, verify by running tmux -V to display the version. Many online resources, including cheat sheets from sources like TheCultOfKaos and Atomicsupergeek, provide quick references for initial configuration and command usage, aiding in a smoother learning curve post-installation. These resources are invaluable for new users.
Installing tmux on macOS
tmux installation on macOS is most conveniently achieved using a package manager like Homebrew. Ensure Homebrew is installed; if not, follow instructions on brew.sh. Once Homebrew is set up, simply run brew install tmux in your Terminal. This command downloads and installs the latest stable version of tmux.
Alternatively, you can use MacPorts with sudo port install tmux. After installation, confirm with tmux -V. Cheat sheets, such as those available via TheCultOfKaos and Atomicsupergeek, offer concise command lists to quickly begin utilizing tmux’s features after a successful installation.
Initial Configuration
tmux’s default configuration is functional, but customization enhances usability. The primary configuration file is .tmux.conf, located in your home directory. If it doesn’t exist, create it. Within this file, you can remap key bindings, alter status bar appearance, and define custom commands.
Resources like cheat sheets from TheCultOfKaos and Atomicsupergeek can inspire configuration changes. Common customizations include changing the prefix key from Ctrl+b and adjusting color schemes. Remember to source the configuration file with tmux source-file ~/.tmux.conf after making changes for them to take effect.

Basic tmux Commands
tmux commands, often prefixed with Ctrl+b, manage sessions and windows. Cheat sheets detail essential actions like detaching, attaching, and listing sessions efficiently.
Starting a tmux Session
Initiating a tmux session is remarkably straightforward. Simply typing “tmux” in your terminal launches a new session, attaching you to it immediately. For a named session, utilize the command “tmux new -s sessionname”, replacing sessionname with your desired identifier.
This allows for easy reconnection later. Cheat sheets, such as those available via cheatography.com, highlight these core commands. Remember, a session persists even after you detach, preserving your work. The “tmux ls” command, detailed in available resources, lists all active sessions, aiding in identification before attaching.
Detaching from a tmux Session
To gracefully disconnect from a tmux session without terminating it, employ the detachment sequence: press Ctrl+b, then release, and subsequently press the ‘d’ key. This leaves the session running in the background, preserving all your active windows and panes.
Cheat sheets, like those from TheCultOfKaos, clearly illustrate this crucial shortcut. Detaching is essential for maintaining persistent terminal environments. You can then reattach later using “tmux attach” or “tmux a”. Remember, detachment doesn’t close the session; it simply disconnects your current terminal.
Listing tmux Sessions
To view all currently running tmux sessions, utilize the command “tmux ls”. This command displays a concise list of session names and their associated IDs. Cheat sheets, such as the one provided by Atomicsupergeek, prominently feature this command for quick reference.
The output helps identify available sessions for attachment. If no sessions are running, the command will return an empty list. Understanding how to list sessions is fundamental for managing multiple terminal workflows effectively within tmux, ensuring you can easily reconnect to your work.
Attaching to an Existing Session
Reconnecting to a detached tmux session is achieved using the “tmux attach” or “tmux a” command. To attach to a specific session, use “tmux a -t sessionname” or “tmux attach-session -t sessionname”, replacing “sessionname” with the desired session’s name.
Cheat sheets from resources like TheCultOfKaos and Atomicsupergeek highlight these commands. If you omit the session name, tmux will attempt to attach to the most recently used session. This functionality is crucial for resuming work seamlessly, preserving your terminal state and workflows.

Window Management
tmux allows creating, switching, renaming, and closing windows within a session. Cheat sheets detail commands for efficient window manipulation, enhancing workflow organization.
Creating New Windows
tmux facilitates creating new windows within an existing session, expanding your workspace without needing multiple terminal instances. The primary command, as highlighted in various cheat sheets like those from TheCultOfKaos and Atomicsupergeek, is Ctrl+b c. This key combination instantly spawns a fresh window, numbered sequentially.
You can also explicitly create a named window using the command tmux new-window -n “Window Name”. This is particularly useful for organizing tasks and quickly identifying specific windows. Remember to consult a cheat sheet for a comprehensive list of window management commands and customizations available within tmux.
Switching Between Windows
tmux offers several methods for navigating between open windows within a session. The most common and efficient method, detailed in cheat sheets by TheCultOfKaos and Atomicsupergeek, is using Ctrl+b n to move to the next window and Ctrl+b p to move to the previous window.
Alternatively, you can directly select a window by its number using Ctrl+b followed by the window number (0-9). For sessions with numerous windows, Ctrl+b w presents a window list for visual selection. Mastering these shortcuts significantly enhances workflow efficiency within tmux.
Renaming Windows
tmux allows you to assign descriptive names to windows, improving organization and clarity, especially in complex sessions. According to cheat sheets from resources like TheCultOfKaos and Atomicsupergeek, the process begins with pressing Ctrl+b, then releasing and pressing , (comma).
This action prompts tmux to request a new name for the current window. Enter your desired name and press Enter to confirm. Renamed windows are clearly displayed in window lists and status bars, making it easier to identify and switch between tasks within your tmux environment.
Closing Windows
tmux provides a straightforward method for closing windows when tasks are completed or no longer needed. Utilizing the key bindings detailed in cheat sheets from sources like TheCultOfKaos and Atomicsupergeek, you can close the current window by pressing Ctrl+b, releasing, and then pressing x.
tmux will prompt for confirmation before closing the window, preventing accidental closures. Confirming the action removes the window from the current session. Remember that closing a window doesn’t terminate any processes running within it; they continue in the background.

Pane Management
tmux’s pane management, detailed in cheat sheets, allows splitting the terminal for concurrent tasks. Horizontal and vertical splits enhance productivity and workflow.
Splitting Panes Horizontally
tmux facilitates horizontal pane splitting, enabling side-by-side terminal views within a single window. This is commonly achieved using the key combination Ctrl+b “ (double quote). Cheat sheets, such as those available via cheatography.com, clearly illustrate this command.
Horizontal splitting is incredibly useful for comparing files, monitoring logs, or running multiple commands simultaneously. The resulting panes function as independent terminals, allowing for separate input and output streams. Users can navigate between these newly created panes using Ctrl+b followed by the arrow keys. Mastering this technique significantly boosts terminal efficiency and multitasking capabilities within a tmux session.
Splitting Panes Vertically
tmux empowers users to split panes vertically, creating stacked terminal views within a window. This is typically accomplished using the key sequence Ctrl+b % (percent sign). Numerous tmux cheat sheets, including those found on cheatography.com, prominently feature this command for quick reference.
Vertical splitting proves invaluable for tasks like code compilation alongside editing, or viewing output while simultaneously running a command. Each resulting pane operates as an independent terminal, accepting distinct input and displaying separate output. Navigation between these panes is easily managed with Ctrl+b and the arrow keys, enhancing productivity within a tmux session.
Switching Between Panes
tmux facilitates seamless navigation between active panes within a window using key bindings. The most common method involves holding Ctrl+b and pressing either the left or right arrow key. Cheat sheets, such as those available via TheCultOfKaos and Atomicsupergeek on cheatography.com, clearly illustrate this functionality.
Alternatively, Ctrl+b followed by the spacebar cycles through panes in a predefined order. Mastering pane switching is crucial for efficient multitasking within a tmux session, allowing quick access to different terminal processes. These shortcuts significantly reduce the need for mouse interaction, boosting overall workflow speed and convenience.
Resizing Panes
tmux allows dynamic adjustment of pane sizes to optimize screen real estate. Initiate resizing by holding Ctrl+b and then pressing a directional arrow key (up, down, left, or right). Repeatedly pressing the arrow key continues to resize the pane in that direction.
Cheat sheets from resources like TheCultOfKaos and Atomicsupergeek detail these commands. For finer control, hold Ctrl+b and use the arrow keys while pressing Ctrl simultaneously. This enables resizing in smaller increments. Efficient pane resizing is vital for viewing lengthy output or accommodating larger applications within your tmux environment.

Session Management
tmux sessions persist across terminal disconnections. Cheat sheets detail commands like tmux new -s sessionname to create, and tmux ls to list sessions.
Naming Sessions
Assigning descriptive names to tmux sessions significantly improves organization, especially when managing multiple projects or tasks concurrently. Utilizing the tmux new -s sessionname command during session creation allows for immediate naming.
Alternatively, existing sessions can be renamed, though this requires a bit more finesse involving server commands and potentially re-attaching. Cheat sheets, such as those available via cheatography.com, highlight the importance of session naming for efficient workflow.
Properly named sessions simplify re-attachment using tmux attach -t sessionname, eliminating guesswork and boosting productivity. Consistent naming conventions are highly recommended.
Killing Sessions
Terminating a tmux session releases its resources and removes it from the active list. This is crucial for cleanup and preventing resource exhaustion when sessions are no longer needed. The command tmux kill-session -t sessionname effectively removes a specified session.
However, be cautious – this action is irreversible, and any unsaved work within the session will be lost. Cheat sheets, like those found on cheatography.com, emphasize the importance of confirming session termination.
Before killing, ensure all critical data is saved. Alternatively, detaching a session preserves its state for later re-attachment.
Sharing Sessions
tmux facilitates collaborative work by enabling session sharing between users. This feature allows multiple individuals to connect to and work within the same terminal environment simultaneously, fostering real-time collaboration on projects or debugging efforts.
While the provided snippets don’t detail the exact commands, sharing typically involves granting another user access to an existing session. Security considerations are paramount when sharing sessions, as all participants have equal control.
Referencing a tmux cheat sheet can clarify the specific commands for secure session sharing and access control.
Detaching and Reattaching Sessions
A core strength of tmux lies in its ability to detach sessions, allowing processes to continue running even after disconnecting from the terminal. This is invaluable for long-running tasks or remote server management.
TheCultOfKaos’s cheat sheet highlights Ctrl+b d as the default key combination for detaching. Reattaching is equally straightforward, using commands like tmux a or tmux attach, potentially specifying the session name with tmux a -t sessionname.
Cheat sheets provide a quick reference for these essential commands, ensuring seamless workflow interruption and resumption.

Key Bindings and Customization
tmux utilizes a prefix key (Ctrl+b) followed by commands. Cheat sheets list these, and customization via .tmux.conf enhances workflow efficiency.
Understanding the Prefix Key (Ctrl+b)
tmux operates using a prefix key, universally set to Ctrl+b, as a foundational element for command execution. This key combination signals to tmux that the subsequent keypress is intended as a command, rather than input for a running application within a pane.
Essentially, you press Ctrl+b, release both keys, and then press the command key. Cheat sheets, such as those available via cheatography.com, extensively document these commands. Without the prefix, keypresses are directed to the application in the current pane. Mastering this prefix is crucial for efficient tmux usage, unlocking its full potential for terminal management and workflow optimization.
Listing Key Bindings
tmux allows users to view currently assigned key bindings directly within a session. Pressing Ctrl+b followed by the question mark key (?) displays a comprehensive list of available commands and their corresponding key combinations. This interactive help screen is invaluable for discovering and remembering commands, especially when initially learning tmux.
Cheat sheets, like those from TheCultOfKaos, provide a static reference, but the in-session listing offers dynamic access to the current configuration. Understanding these bindings is key to efficient workflow. The listing is context-sensitive, reflecting any customizations made in your .tmux.conf file.
Customizing Key Bindings
tmux’s flexibility extends to key bindings, allowing users to tailor commands to their preferences. The bind-key command, accessible directly within a session by pressing Ctrl+b then a colon (:), enables immediate customization. This opens a prompt where you can redefine existing bindings or create new ones.
For persistent changes, modify the .tmux.conf configuration file. Cheat sheets often highlight common customizations, but the possibilities are vast. Remember to reload the configuration (using Ctrl+b followed by :source-file ~/.tmux.conf) after making changes for them to take effect. This personalization boosts efficiency.
tmux Configuration File (.tmux.conf)
The .tmux.conf file is central to persistent tmux customization. Located in your home directory, this file stores settings for key bindings, status bar appearance, and default behaviors. Editing this file allows you to define a personalized tmux environment that survives session restarts.
Cheat sheets often provide example configurations to get you started. After modifying .tmux.conf, reload the changes within a tmux session using the command Ctrl+b followed by a colon (:) and then source-file ~/.tmux.conf. This ensures your new settings are applied immediately.

Advanced tmux Features
tmux excels with copy mode, pane synchronization, and automatic session restoration. Plugins further extend functionality, enhancing productivity—refer to cheat sheets for quick access!
Copy Mode
tmux’s copy mode allows you to easily select and copy text from within a pane, functioning similarly to vi or emacs editing. Initiate copy mode by pressing Ctrl+b [. Use the arrow keys to navigate and spacebar to start selection; move the cursor to highlight the desired text. Press enter to copy the selected text to your system clipboard.
Cheat sheets, such as those available via cheatography.com, detail these key bindings. Remember to exit copy mode by pressing Esc. This feature is invaluable for quickly transferring information between tmux sessions and other applications, boosting overall efficiency.
Synchronization of Panes
tmux offers pane synchronization, enabling you to send the same command to multiple panes simultaneously. This is incredibly useful for tasks like running updates or deploying code across several servers. Activate synchronization by pressing Ctrl+b :setw synchronize-panes on. Subsequently, any command entered in the active pane will be replicated in all synchronized panes.
Refer to cheat sheets from resources like TheCultOfKaos for quick reference. To disable synchronization, use Ctrl+b :setw synchronize-panes off. This feature significantly streamlines repetitive tasks, improving workflow efficiency within your tmux environment.
Automatic Session Restoration

tmux can automatically restore sessions upon system reboot, preventing loss of work. This functionality relies on configuring tmux to save session data periodically. While the provided snippets don’t detail this directly, it’s a crucial feature for long-running tasks. Ensure your .tmux.conf file includes settings to enable automatic saving and restoration.
Consult cheat sheets, such as those available via cheatography.com, for specific configuration examples. Proper setup guarantees your active sessions, windows, and panes are revived after unexpected shutdowns, enhancing productivity and minimizing disruption. Regularly back up your .tmux;conf file!
tmux Plugins
tmux’s functionality extends significantly through plugins, enhancing its capabilities beyond the core features. While the provided cheat sheets (TheCultOfKaos, Atomicsupergeek via cheatography.com) don’t cover plugins directly, they represent a powerful customization avenue. Popular plugins add features like status bar enhancements, theme support, and improved copy/paste functionality.
Plugin management typically involves tmux Plugin Manager (TPM). Installation and configuration require adding specific lines to your .tmux.conf file. Explore online resources for plugin discovery and setup instructions to tailor tmux to your precise workflow needs.

Resources and Cheat Sheets
tmux documentation is readily available online, alongside numerous cheat sheets – notably from TheCultOfKaos and Atomicsupergeek – for quick command lookups.
Official tmux Documentation
tmux boasts comprehensive official documentation, serving as the definitive resource for understanding its functionalities. While cheat sheets offer quick references – such as those created by TheCultOfKaos and Atomicsupergeek – the official documentation provides in-depth explanations of every command, configuration option, and advanced feature.
It details session management, window and pane manipulation, key bindings, and customization options. Users can find detailed explanations of how to create, detach, and reattach sessions, split panes, and customize the tmux environment to suit their specific needs. Accessing this documentation is crucial for mastering tmux beyond basic usage and troubleshooting complex configurations.
Online tmux Cheat Sheets
tmux users benefit from numerous online cheat sheets, providing concise command references. Resources like cheatography.com host excellent options, notably those created by TheCultOfKaos and Atomicsupergeek. These sheets distill essential commands for session management (creating, listing, attaching), window control, and pane manipulation into easily digestible formats.
They’re invaluable for quick lookups and remembering less frequently used key bindings. While not exhaustive like the official documentation, cheat sheets accelerate learning and boost productivity. Searching “tmux cheatsheet pdf” yields downloadable versions for offline access, ensuring assistance is always at hand, even without an internet connection.