AOG Poston
a software engineer

Commands for Tmux
by AOGPoston on 12/05/23

Over the past few days I have been learning how to use the terminal for development and writing. I noticed many youtuber who's tutorials I followed would be using Tmux, so I investgated. Turns out Tmux is a great tool to add to my toolbox.

What is Tmux

Tmux is a terminal multiplexer. Me: "I know what those words are seperately, but not together"

So simply, Tmux is an application which allows you to run multiple terminal instances in one application instance. What this means practically is that you could open a terminal, ssh into a server and run, let's say, npm run dev to spin up a hot reloading server, then without stopping that server, you could also use vim to code.

Tmux also allows you to have sessions with multiple window panes to work in. There are several other features that make tmux a valuable tool, but the reason youre is to quick reference the commands so you probably already know what tmux is.

Tmux Commands

  • Ctrl+B D — Detach from the current session.
  • Ctrl+B % — Split the window into two panes horizontally.
  • Ctrl+B " — Split the window into two panes vertically.
  • Ctrl+B Arrow Key (Left, Right, Up, Down) — Move between panes.
  • Ctrl+B X — Close pane.
  • Ctrl+B C — Create a new window.
  • Ctrl+B N or P — Move to the next or previous window.
  • Ctrl+B 0 (1,2...) — Move to a specific window by number.
  • Ctrl+B : — Enter the command line to type commands. Tab completion is available.
  • Ctrl+B ? — View all keybindings. Press Q to exit.
  • Ctrl+B W — Open a panel to navigate across windows in multiple sessions.

-Amon