tmux is an open-source terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window.
Tmux is useful for running more than one command-line program at the same time. It can also be used to detach processes from their controlling terminals, allowing remote sessions to remain active without being visible.
So In this guide , we will explain how to install tmux on Linux.
Install tmux on Linux
- Run the command based on your own running Linux distribution.
RHEL or CentOS
dnf install tmux -y #CentOS/RHEL7 yum install tmux -y #CentOS/RHEL8
Debian or Ubuntu
sudo apt install tmux -y
dnf install tmux -y
pacman -S tmux
zypper install tmux
brew install tmux #Using Homebrew port install tmux #Using MacPorts
Starting tmux Session
So Start the tmux session using the command below.
- If you need to run more than one terminal multiplexer to keep all SSH sessions running in the background, in that case, you may find difficulties to switch between tmux to tmux. These commands below used to switch one form another.
tmux detach tmux attach tmux attach -t 2
Note: when you create a session with tmux, you can attach this tmux session with command :
You may notice that the attached session tracing the main session in everything and every command as well.
It acts as a mirror to the main one.
- To check all the tmux screen use the tmux list command.
In this article, we have seen how to install tmux on Linux and how to start a tmux session.