Tmux is great tool which saves system administrators from a lot of unnecessary workloads. Tmux is creating multiple screens, split current screen and maybe the best part even ssh is closed it resumes to work and after reconnect we can resume from where we were.
We will start tmux terminal emulator simply providing it to bash. We will see a screen like below. We can see that there is a bar below the screen which provides some information like the window list, active window, hostname, time and date.
During the usage of the tmux terminal, we will use a control keyboard shortcut in order to create new windows, split them. This is CTRL+B .
Split Tmux Screen Horizontally
We will split tmux screen horizontally and create new work windows. We will use CTRL+B and after % . As we know CTRL+B is default function tool
Split Tmux Screen Vertically
Similar to the previous example but the split will occur vertically. The cursor will move to the newly created tmux window.
Create New Tmux Pane
We will create a new pane next to the current pane. We can see below in the status bar there is 3 panes named with bash and numbered as 1, 2 and 3.
Navigate To The Previous Window
We can navigate with p and n keys
CTRL+B p will naviagte to previous windows
CTRL+B n will navigate to next window
To kill a tmux pane
CTRL+B x key combination is used. We will be asked the question “kill-pane 0”. We have to answer with
y which means yes to kill currently active pane.