Tmux is a Linux application that allows multitasking in a terminal window. It stands for Terminal Multiplexing and is based around sessions. Users can start a process, switch to a new one, detach from a running process, and reattach to a running process.
Prerequisites
- A Linux-based system
- A user account with sudo or root privileges
- Access to a terminal window / command line
Install tmux
To install Tmux using default repositories, run the installation command using the system’s default package manager. on Debian/Ubuntu-based systems
sudo apt-get install tmux
Tmux, basically, uses when you’re connected remotely to a Linux server with SSH, this will preserve your session if you are disconnected from installing any packages. You can detach from the session on one computer, switch to a second computer, and reconnect to the server, and re-attach to the same session. Unlike some other applications, tmux runs remotely on the server
Start New tmux Session
To start a new session, in a terminal window type:
tmux
Your screen will change and display a status bar at the bottom. In the lower-left, you’ll see the name and number for the window: [0] 0:bash*
In the lower-right, the date and time are displayed. Just beside the date and time, you’ll see the logged-in user and host: username@host-server. Now start working on the remote server.
You can re-attach to the session by typing:
tmux attach
The system will re-enter the live tmux session, and pick up just where you left off.
Personally, I loved this utility, it helps me a lot when I work on remote servers.
Reference: