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.

Qadry
unixcop Admin

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

You might also likeRELATED

How to Count Number of Files and Sub-directories inside a Directory

Hi guys, In this article we will show you how to count the number of files and sub-directories in a directory using a tree command. Count number...

Find Top 10 IP Addresses Accessing Your Apache Web Server

In this post, you will learn how to Find Top 10 IP Addresses Accessing Your Apache Web Server- The monitoring access to your web server...

How to Install MongoDB in CentOS 8

Introduction MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL). MongoDB is a...