Some Helpful TMUX Shortcuts
I have a file that I keep on my web server that has a list of helpful shortcuts but I’m always sshing in to read it so instead I decided to use my head for a little thinking and put it on here so 1.) I can find it easier and 2.) hopefully someone will get some use of this. Here is a few of the ones I use quite regularly:
- tmux new -s sessname (Create a new session)
- tmux a -t sessname (Re-attach to a session)
- tmux kill-session sessname (Kill a session)
- ctrl + b + Up|Down|Left|Right arrows (Switch panes)
- ctrl + b + q (Shows active pane numbering and sizes)
- ctrl + b + ” (Creates a new pane)
- ctrl + b + c (Creates a new window)
- ctrl + b + w (Shows you a list of your windows)
- ctrl + b + , (Rename the current window)
- ctrl + b + x (Kill pane)
- ctrl + b + & (Kill window)
- ctrl + b + d (Save and exit session)
- ctrl + b + alt + Up|Down|Left|Right arrows (Resize window panes)
You can also change settings in your .tmux.conf file. I’ve only done some basic ones but I will list them for you:
# Use Ctrl A instead of Ctrl B
unbind C-b
set -g prefix C-a
# Resize pane by 1 unit
bind-key + resize-pane -D 1
bind-key - resize-pane -U 1
bind-key / resize-pane -L 1
bind-key * resize-pane -R 1
If you do a search on Google you will find some much more advanced stuff than the few things I have listed here. Hopefully some of this is helpful to ya.`