Tmux is a terminal multiplexer, this means it allows you to run several programs at once from the command line either in a single screen in ‘panes’ or in several tabs or ‘windows’. Making it incredibly easy to multitask or keep an eye on running systems. If you are using SSH to connect to a server you can keep programs running through disconnects.
Please note all the key combinations I have used are for a UK keyboard.
Most package managers have tmux in their repositories, but if you can’t find it a quick search online should find it.
To open tmux you type the command “tmux”.
For all non typed commands you use a prefix which is by default ‘ctrl-b’, then press the button/s for the command
To split this pane vertically use the prefix then ‘%’ (shift-5).
To split the currently active pane horizontally use ‘”‘ (shift-2).
To change between active panes use ‘o’. You can run any program in a pane and use the other panes at the same time, allowing you to keep an eye on, htop or any other running programs.
If you want to remove a pane use ‘x’.
To connect to an already running session use
Another part are windows, windows or tabs is another screen which can be broken up into panes.
Windows are useful if you want to do a large amount of editing or need more screen real estate.
To switch windows use ‘p’.
For creating a new window use ‘c’.
To name a window to make it easier to find, use ‘,’
Use ‘&’ to kill a window
To disconnect from a session but keep it running in the background use ‘d’
To reattach type ‘tmux attach’
These are some of the basic commands to get you going in Tmux but there are loads more for more complex usage.