tmux is a terminal multiplexer written in C. It enables a number of terminals to be created, accessed, and controlled from a single screen. It is similar to GNU Screen tool. A user can easily manage multiple tasks and command line programs on a Linux system, without having to open many Terminal windows. tmux may be detached from a screen and continue running in the background, then later reattached.
[email protected]:~$ sudo apt-get install tmux
It will not be found in official repositories. So add EPEL repository to install tmux.
[[email protected] ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Now install tmux with the following command:
[[email protected] ~]# yum install tmux
To start tmux, simply enter the following command:
[[email protected] ~]# tmux
Now you will be placed in the new tmux session. The default prefix key stroke is “CTRL+B”. You will need to first press these key pairs for any other commands. For complete list of commands first press “CTRL+B” then press “?”. This command will list all possible key bindings.
Create new tmux session
To create a new tmux session press “CTRL+B” and then press “C”. You will be placed in the new session.
To list all sessions and move between sessions press “CTRL+B” and “W” keys. Use the arrow keys to select the session you want to attach and press Enter. You will be attached to corresponding session. To exit from a session, simply type the command “exit”.
To split the current window vertically, press “CTRL+B” and press “%” key.
Detach from session
To detach from a session, press “CTRL+B” and press “D”. You will be detached from all sessions and redirected to original terminal screen.
To go back to sessions (resume), enter the following command:
[[email protected] ~]# tmux attach
Now you will be attached to original session where you came from. For more example about tmux command refer the man pages:
[[email protected] ~]# man tmux