My tmux cheatsheet
If you often work on a remote server, then probably you should give tmux a try.
Here is what I often do when I open my MacBook Pro for work:
- Open
iTerm2andsshto the remote server that I am working on; tmux attachto the session where I leave off yesterday;- I can continue my work instantly.
Below are my most frequently used commands. List them here for a quick reference.
| operation | command |
|---|---|
| session | |
| create | tmux new -s test |
| show | C-b s |
| tmux ls | |
| detach | C-b d |
| tmux detach | |
| attach | tmux a -t test |
| kill | tmux kill-session -t test |
| rename | C-b $ |
| tmux rename-session -t test test2 | |
| window | |
| create | C-b c |
| rename | C-b , |
| next | C-b n |
| previous | C-b p |
| go to | C-b |
| list | C-b w |
| close | C-b & |
| pane | |
| create horizontally | C-b “ |
| create vertically | C-b % |
| show number | C-b q |
| togger panes | C-b o |
| swap panes | C-b { |
| C-b } | |
| move | C-b h |
| C-b j | |
| C-b l | |
| C-b k | |
| kill | C-b x |
| break to window | C-b ! |
| complete list | C-b ? |