Skip to content

TMUX

tmux is a very powerful terminal tool that allows creating multiple terminal sessions in a single window, creating panels dividing a terminal session into multiple sections, moving between sessions and panels, and detaching and attach a background terminal session.

In this short tutorial, we'll look at the most commonly used commands in tmux.

To start tmux, just type "tmux" in the terminal.

Creating Terminal Sessions:

  • Ctrl+B then C. This will create a new window in the current session.

Navigate between terminal sessions:

  • Ctrl+B then N to go to the next session

  • Ctrl+B then P to go to the previous session.

Creation of panels: To create a panel:

  • Ctrl+B then % to divide the window into two vertical panels.

  • Ctrl+B then " to divide the window into two horizontal panels.

Navigation between panels:

  • Ctrl+B then Left or Right to move between the vertical panels.

  • Ctrl+B then Up or Down to move between the horizontal panels.

Detaching and attaching a terminal session

  • To detach a terminal session: Ctrl+B then D. This will detach the terminal session in the background.

  • To attach a detached terminal session, type tmux attach.

tmux output

  • To exit a tmux terminal, type exit in the terminal.
  • To exit tmux completely, use Ctrl+B :kill-session

tmux commands link: https://tmuxcheatsheet.com