Qadry
unixcop Admin

How to install tmux on Linux

Introduction

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

Fedora

dnf install tmux -y

Arch Linux

pacman -S tmux

openSUSE

zypper install tmux

macOS

brew install tmux    #Using Homebrew
port install tmux    #Using MacPorts

Starting tmux Session

So Start the tmux session using the command below.

tmux
  • 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 :

tmux attach

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.
tmux ls

Conclusion

In this article, we have seen how to install tmux on Linux and how to start a tmux session.

Thank you.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

x