This is my documentation on how to use tmux which is a tool that allows users to run multiple tasks within a single window.
Knowledge#
Similar to the previous blog post, this is an addon to the Linux command-line (Bash). Ubuntu and Kali Tool are recommended for this challenge.
Walkthrough#
Task 1#
Firstly, you must install tmux into your linux system. This could be done through using the following command:
sudo apt-get install tmuxYou will be asked your password in order to continue the installation.
Task 2#
After installation, you are now able to use tmux. When using the following command:
tmuxIt will open the tmux software, which is essentially another terminal but more available functions such as multitasking.
Task 3#
All tmux commands start with two keyboard combinations. The first keyboard combination key is:
ControlTask 4#
The second keyboard combination key is:
BTask 5#
To detach a session, firstly you press the two combination keys of “Control + B”, follow by the key:
DWhat detaching does is similar in creating new windows in a internet browser. This would create multiple sessions and can be used later by “tabbing” through using “Control + B” followed by either the ‘(’ or ‘)’ key. Make sure to use the shift key.
Task 6#
To list all your windows or sessions, you use the command:
tmux lsTask 7#
By default; without setting the session name, the names will begin from:
0The numbers will increase as more sessions are created.
Task 8#
To choose the session that you just created, you use the command:
tmux a -t 0If you want to use a specific session, replace the “0” in the above command with the name of your session that is listed with the “tmux ls” command.
Task 9#
To create a new window within a session, firstly you press the two combination keys of “Control + B”, follow by the key:
CCreating a new window within a session is essentially creating a “tab” within an internet browser. You are able to “tabbing” through using “Control + B” followed by either the ‘N’ or ‘P’ or ‘0-9’ keys.
Task 10#
Does not exist.
Task 11#
Does not exist.
Task 12#
When your tmux terminal is filled, you should use “Copy Mode” in order to scroll up and down. Firstly you press the two combination keys of “Control + B” followed by the key:
[Task 13#
As of February 2020, the key does not go to the very top.
gTask 14#
As of February 2020, the key does not go to the very bottom.
GTask 15#
To quit “Copy Mode” you use the key:
qTask 16#
To split windows vertically, you press “Control + B” followed by the key:
%Task 17#
To split windows horizontally, you press “Control + B” followed by the key:
"Task 18#
Does not exist.
Task 19#
Does not exist.
Task 20#
Does not exist.
Task 21#
To remove a pane, you press “Control + B” followed by the key:
XTask 22#
To close the tmux session, it can be done by typing within the command-line:
exitTask 23#
To create new sessions with a name of “neat” you type within the command-line:
tmux new -s neatConclusion#
In short; to cut down all the learning, I believe that the most useful commands would be:
- tmux:
- To initiate it within the Linux command-line.
- CTRL + B + [RELEASE] + %:
- Split the window vertically.
- CTRL + B + [RELEASE] + &:
- Split the window horizontally.
- CTRL + B + [RELEASE] + (ARROW KEYS):
- Swap between panels.
- CTRL + B + [RELEASE] + C:
- Create new tab.
- CTRL + B + [RELEASE] + N/P:
- Move to next/previous tab.
- exit:
- To close a tmux window or exit out of tmux.
After learning this add-on within the Linux command-line, it has increased my productivity as I can monitor multiple tasks within one window. It is most definitely faster than “Alt-Tabbing” and it is quick to learn.