Learn Termux a Terminal Multiplexer

Learn the best tool you can have on a non-GUI server or machine.

tmux

Installation

  • Linux : sudo apt-get install tmux
  • Fedora : sudo dnf -y install tmux
  • Cent-OS : sudo yum -y install tmux
  • Arch Linux : sudo pacman -S tmux
  • to start : tmux
  • NOTE: Prefix key : Ctrl+b
  • github

What is tmux ??

  • It is terminal multiplexer.
  • It acts as a window manager in your terminal.
  • It also allows to create multiple window and panes in a single terminal window.

What it can do

  • Tmux keeps the sessions , windows and panes in a server located at /tmp/tmux
  • If your terminal window is crash or killed(detach) then still all your process and session is alive, until you kill the tmux server(reboot).
  • Again you can pick the session from where you left by simply attaching to the session.
  • tmux is also helpful while working with remote machine.

tmux key binds

NOTE: Prefix key C-b == Ctrl+b

  • to start : tmux
  • Splitting Pane :
    • for left and right : C-b+%
    • for top and bottom : C-b+"
  • Navigates through panes :
    • C-b+<arrow_keys
    • to move left : C-b ⬅
    • to move right : C-b âž¡
    • to move up : C-b ⬆
    • to move down : C-b ⬇
  • Closing pane: type exit or C-b x
  • Creating windows : C-b c
    • rename windows : C-b ,
    • to kill window : C-b &
  • Navigates through windows :
    • for previous window : C-b p
    • for next window : C-b n
    • for required : C-b <number> where number is number in front of the window’s name in your status bar
  • Session handling :
    • to detach your current session : C-b d
    • for list of session to detach : C-b D
      • for list of session : C-b s
      • for list of session : tmux ls it worked without a tmux session
      • to attach to session from list : tmux attach -t 0 -t 0 -t for specific target and 0 name of the session
      • attach to a new session : tmux new -s database new -s database new for new , -s for session , database as name of session new -w __ -w for new window
      • rename session : C-b $ rename before starting the session : tmux rename-session -t 0 database
  • to enter command prompt mode : C-b :

NOTE : to see the more key bindings use C-b ?

  • It will show the all binding available in it

  1. blog
  2. key-binds_img
  3. YT-video
  4. tmux key binds :
  5. default-key-binds
  6. resize-pane-using-command
  7. to-control-screen
  8. key-binds
Ukant Jadia
Ukant Jadia
Graduate | ML & Software Engineer

My research interests include applied machine learning, visualization, programming boring stuff.