tmux
tmux (Terminal Multiplexer). It allows users to manage multiple terminal sessions from a single window.
Configuration location: ~/.tmux.conf
Hotkeys, shortcuts
ctrl+b cCreate a new windowctrl+b n&ctrl+b pGo to next window, Go to previous windowctrl+[Enter copy mode (allows scrolling)- scroll using
ctrl+u&ctrl+d /searchqto exit copy mode
- scroll using
ctrl+b dDetatch from current session in current terminal
Windows/panes:
ctrl+b space: Change layout (vertical / horizontal)ctrl+b ,: rename windowctrl+b alt+2: Vertically balance out split pane sizesctrl+b alt+1: Horizontally balance out split pane sizes
Split panes:
ctrl+jorctrl+k: Focus on top/bottom pane (go to)ctrl+": Create new window in horizontal split screenctrl+UPorctrl+Down: Change size of the current split panectrl+!: Move split pane into its own window
Commands, actions
To enter command mode use: ctrl+b :
move-window -t [num]: move the current window to a new window number
???
-d: any other clients attached to the session are detached-t: attach to target with name:id-n: name the window
tmux new-window -t hawkhost:1 -n 'Server1' 'ssh root@10.x.x.x'
#
tmux new-session -d 'vi /etc/passwd' \; split-window -d \; attachDocs
Cheatsheet
Blogs
- https://tmuxp.readthedocs.io/en/latest/about_tmux.html#text-based-window-manager
- https://www.bugsnag.com/blog/benefits-of-using-tmux
- https://www.bugsnag.com/blog/tmux-and-vim (has very good Related reading articles at the bottom)
- https://blog.hawkhost.com/2010/07/02/tmux-%e2%80%93-the-terminal-multiplexer-part-2/#tmux-shell-scripting