Using tmux – shortcuts

Even though Windows 7 is my main OS I use terminals a lot. I don’t mean the Windows command prompt in this case, though I actually use that a lot as well. The terminal I’m talking about now is Bash, which I use on my Raspberry Pi, VPS’s and virtual machines. To connect to these systems I use PuTTY.

The biggest benefit tmux gives is not having to open several terminals. Instead you use tabs (windows) or you split the current window. When I’m working on a project which has its own dedicated virtual machine (through Vagrant) I usually log in, create a 2×2 grid, setup 2 panes for tailing log files, another connects to MySQL and the 4th is available for regular terminal stuff.

Another nice feature is being able to detach your current session and return to it later. I do that with my Raspberry Pi for instance. Inside my tmux session I run irssi (an IRC client) and instead of having to reconnect all the time I just detach the session when I’m done, and recover it whenever I need to hop on IRC again.

Key in using tmux effectively is knowing the shortcuts. Memorizing them improves productivity a lot. So to help you get started I listed the main ones below.

  • ctrl+b % or ctrl+b " for pane splitting
  • ctrl+b space for changing pane orientation
  • ctrl+b n for next window
  • ctrl+b arrow keys for pane selection (older versions only support up/down)
  • ctrl+b , for renaming window
  • ctrl+b d for detaching session (close without shutting it down)
  • tmux a to resume a detached sessions

Am I missing any neat shortcuts? Let me know by dropping it in the comments.

Scroll to Top