Tmux — For Ninjas

Written by aamralkar | Published 2018/08/31
Tech Story Tags: tmux | linux

TLDRvia the TL;DR App

Its been quite long I am using Tmux. Terminal muxer, or multiplexer. Tmux is beautiful utility to make your terminal more powerful. Once you install Tmux your terminal can be divided into multiple sessions and can increase parallelism.

  • A sessions can have multiple windows.
  • A window is a single view.
  • A Window can further split into panes.

Tmux installation is straight forward. It is available as package in almost all major linux distributions.

Tmux can be installed on all major Linux/mac with below commands.

For Debian/Ubuntu distributions

sudo apt-get install tmux

For Fedora distribution

sudo dnf install tmux

And For RPM based distributions

sudo yum install tmux

For Mac

brew install tmux

For Windows

Sorry Not Available

prefix + d is be default but I do use prefix + t , that means you would first hit (and release) Control + b and then type d.

Session

For your first session simply type tmux in terminal:

tmux

This will create a new tmux session. Once you run above command you will see your terminal turns like below.

Just use exit to get out of your tmux first session. Just remember ctrl + b is your default prefix.

Note:- (= prefix ctrl +b)

Pane(s)

Terminal can be split further into numerous panes. prefix + % for vertical split and prefix + “ for horizontal split.

To navigate between pane use prefix + arrow-keys .

To close panes ctrl+d or simply exit.

To make pane full size just hit prefix + z.

To toggle between different pane prefix + o.

Also to display clock in pane hit prefix + t.

Some useful commands

  1. List all the running sessions

tmux ls

You should see below like output for above command

0: 1 windows (created Fri Aug 31 15:10:27 2018) [173x45] (attached)

2. Start new session in tmux with name

tmux new -s abhishekamralkar

Please change abhishekamralkar to whatever you want to name your session.

3. To attach to sessions

tmux a -t 0

Above command with attach us to session 0.

To check what all commands available with tmux run

prefix + ?


Published by HackerNoon on 2018/08/31