How to Install and Use tmux on Ubuntu 16.0

Posted By : Mohd Adnan | 28-Feb-2018

 Are you the one to whom it fascinates working on a terminal?


Do you have a hard time switching to multiple terminals at the same moment?


Well, the solution is here - tmux


What is tmux?


According to Wikipedia - tmux is a terminal multiplexer, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session

The term may sound techie, but the concept is simple: Within one terminal window, you can open multiple windows and split-views (panes in tmux lingo). Each pane has it's own individual terminal instance.




Run the following commands to install tmux


sudo apt update

sudo apt-get install tmux         


Getting started: Starting Your First Session


Once, it's installed on your OS; you just need to start a tmux session by typing 'tmux' on the terminal

tmux session


Getting hands-on tmux


The following screenshot shows how a tmux session looks like:

tmux session


The fundamental thing you should keep in mind is that Ctrl+b is the default prefix in tmux. It indicates that to run any command, you need to type a prefix Ctrl+b first. This step is taken to avoid clash with key combinations adopted in other programs operating in the terminal.


Here is cheatsheet for few basic tmux commands that will keep you going with tmux:

to split pane horizontally — Ctrl+b %  
to split pane vertically — Ctrl+b " 
to switch pane — Ctrl+b arrow key
to resize panes — Hold Ctrl+b, hold one of the arrow keys 
to (c)reate a new window — Ctrl+b c
to move to the (n)ext window — Ctrl+b n
to move to the (p)revious window — Ctrl+b p


Hope that makes you more productive. It's a great hack to make things easier. 


About Author

Author Image
Mohd Adnan

Adnan is a passionate enthusiastic learner, always searching for ways to expand knowledge. Proficient in Java & AWS Cloud Computing Services. As a coder, loves the logic and structure of coding, and always strive to write elegant and efficient code.

Request for Proposal

Name is required

Comment is required

Sending message..