GeekCoding101 make your way to geek

tmux: Cheat Sheet, Scripts and Terminal Setup

4 posts on tmux, newest first.

4posts
2020first post

GeekCoding101 has four hands-on posts tagged tmux, covering:

  • a cheat sheet for panes, windows and sessions
  • a Bash script that rebuilds a six-window dev environment after a reboot
  • a terminal setup built on iTerm and tmux
  • a Kubernetes lab tutorial

Start with Tmux Notes if you want shortcuts. Start with Crafting A Bash Script with Tmux if you want to automate your sessions.

Where to start

If you want to…ReadLength
Look up shortcuts for panes, windows and sessions, plus config, plugins and iTerm2 integrationTmux Notes4 min
Rebuild a multi-window dev session (Django, Celery, Flower, Vue, Heroku) with one script after a rebootCrafting A Bash Script with Tmux4 min
Set up a productive terminal environment around iTerm and tmuxTerminal Mastery: Crafting a Productivity Environment with iTerm, tmux, and Beyond6 min
Build a multi-node Kubernetes lab on a Mac with Rocky Linux 9 VMs in VMware FusionKubernetes Tutorial Part 1: Multi-Node Cluster on a Mac22 min

tmux quick reference

These are tmux’s default bindings. The prefix is Ctrl-b: press it, release, then press the next key. Tmux Notes has the full list and its own .tmux.conf tweaks.

ActionCommand / keys
Start a named sessiontmux new -s name
List sessionstmux ls
Re-attach to a sessiontmux attach -t name
Detach (session keeps running)Ctrl-b d
New windowCtrl-b c
Next / previous windowCtrl-b n / Ctrl-b p
Split pane left/rightCtrl-b %
Split pane top/bottomCtrl-b "
Move between panesCtrl-b + arrow key
Reload config (from tmux command prompt)Ctrl-b : then source-file ~/.tmux.conf

FAQ

What is tmux? tmux is a terminal multiplexer. It lets you run several terminal windows and split panes inside one session. You can also detach from a session and re-attach later while your programs keep running.

Where is the tmux cheat sheet? Tmux Notes is the cheat sheet. It covers shortcuts for panes, windows and sessions, along with configuration, plugins, iTerm2 integration and a customised .tmux.conf.

Does tmux keep my sessions after a reboot? No. tmux sessions live in memory, so a reboot ends them. Crafting A Bash Script with Tmux shows one way around this: a script that recreates a six-window dev environment and restarts its services.

Can I use tmux with iTerm2? Yes. iTerm2 has built-in tmux integration. Tmux Notes and Terminal Mastery both cover using the two together.

Are these posts free? Yes. Every GeekCoding101 post is free to read, with no sign-up.