tmux Command on Linux: Multiplex Terminal with Panels and Sessions
The tmux command in Linux is another terminal multiplexer, like the screen. It allows multiple terminals to be created, accessed, and controlled from a single window.
Just like screen, tmux can be detached from the terminal and continue running, and then reattached to the terminal.
As soon as tmux is executed, it creates a session with a single window and displays it on the terminal screen. A status bar is displayed at the bottom of the terminal indicating the current session.
A session is nothing more than a set of pseudo-terminals controlled by tmux with one or more windows. Windows can occupy the entire screen, or be divided into one or more rectangular panes. Each window will be a pseudo-terminal.
If all sessions are terminated, tmux also terminates.
tmux accepts commands through the Ctrl b key combination.
Once in command mode, the most common options are:
- ; Switches to the previous pane
- c Creates a new window
- d Detaches from the client
- n Switches to the next window
- p Switches to the previous window
- x Kills the current pane
- " Splits the window horizontally
- % Splits the window vertically
To start tmux:
$ tmux
To create a new window with horizontal split, you should type Ctrl b, followed by the single quote " :
Tmux with two horizontal windows |
Keyboard arrows can also be used to switch between panes.
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Like it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.
Tmux with two horizontal windows