Skip to content

dennyzhang/cheatsheet-tmux-A4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

1 Tmux CheatSheet

linkedin
github
slack


PRs Welcome

File me Issues or star this repo.

1.1 Tmux Basic

NameComment
Create new sessiontmux new -s denny
List all sessionstmux ls
Attach to one sessiontmux attach -t denny
Detach sessionC-b d
Kill one sessiontmux kill-session -t denny
List all shortcut keysC-b :list-keys, C-b ? Very useful!
Kill current windowC-b &
Default conf file~/.tmux.conf, ~/.tmate.conf

1.2 Tmux Layout & Scroll

NameComment
Switch to next paneC-b o
Vertically split paneC-b %
Horizontally split paneC-b "
Kill current paneC-b x
Swap two panesC-b C-o
Resize current pane rightC-b :resize-pane -R 20
Resize current pane downC-b :resize-pane -D 10

1.3 Tmux Console Output

NameComment
Enter copy modeC-b [, press q/Esc to exit
Search outputC-b C-s, C-b C-u
Paste buffer to current panelC-b ]
Page up/downEnter copy mode, then use normal navigation keys
Page up/down in MacFn + Up Arrow
Show things in current buffertmux show-buffer
List all buffertmux list-buffers
Save buffer to filetmux save-buffer foo.txt

1.4 Tmate

NameComment
see tmate log messages: ssh conn stringtmate show-messages
Launch tmate in a detached statetmate -S /tmp/tmate.sock new-session -d
Blocks until the SSH connection is establishedtmate -S /tmp/tmate.sock wait tmate-ready
Prints tmate SSH connection stringtmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'
Make your tmate session big by defaultMake your default iterm window big

1.5 More Resources

https://gist.github.com/MohamedAlaa/2961058

https://wiki.freebsdchina.org/software/t/tmux

https://robots.thoughtbot.com/a-tmux-crash-course

https://gist.github.com/Bekbolatov/6840069e51382965fdad

License: Code is licensed under MIT License.

linkedin github slack