TMUX
Handling Terminal
New terminal
$ tmux new -s ${NAME}
Reattach Terminal
$ tmux a -s ${NAME}
Scrolling
Ctrl-b then [ then you can use your normal navigation keys to scroll around (eg. Up Arrow or PgDn). Press q to quit scroll mode.
Shortcut Reference
Now a Ctrl-b options reference:
Basics
? get help
Session management
s list sessions
$ rename the current session
d detach from the current session
Windows
c create a new window
, rename the current window
w list windows
% split horizontally
" split vertically
n change to the next window
p change to the previous window
0 to 9 select windows 0 through 9
Panes
% create a horizontal pane
" create a vertical pane
h move to the left pane. *
j move to the pane below *
l move to the right pane *
k move to the pane above *
k move to the pane above *
q show pane numbers
o toggle between panes
} swap with next pane
{ swap with previous pane
! break the pane out of the window
x kill the current pane
Miscellaneous
t show the time in current pane
Resizing Panes
You can also resize panes if you don’t like the layout defaults. I personally rarely need to do this, though it’s handy to know how. Here is the basic syntax to resize panes:
PREFIX : resize-pane -D (Resizes the current pane down)
PREFIX : resize-pane -U (Resizes the current pane upward)
PREFIX : resize-pane -L (Resizes the current pane left)
PREFIX : resize-pane -R (Resizes the current pane right)
PREFIX : resize-pane -D 20 (Resizes the current pane down by 20 cells)
PREFIX : resize-pane -U 20 (Resizes the current pane upward by 20 cells)
PREFIX : resize-pane -L 20 (Resizes the current pane left by 20 cells)
PREFIX : resize-pane -R 20 (Resizes the current pane right by 20 cells)
PREFIX : resize-pane -t 2 20 (Resizes the pane with the id of 2 down by 20
cells)
PREFIX : resize-pane -t -L 20 (Resizes the pane with the id of 2 left by 20
cells)
References
https://danielmiessler.com/study/tmux/
http://lukaszwrobel.pl/blog/tmux-tutorial-split-terminal-windows-easily
https://gist.github.com/MohamedAlaa/2961058 « Shorcuts sheets