⬆️ ⬇️

A brief cheat sheet for tmux (terminal manager)

tmux is a terminal manager to which it is convenient to connect and disconnect without losing processes and history. Like a screen , only better (primarily because it uses a client-server model).



image



Your attention is invited to a minimalist cheat sheet that allows you to quickly start using tmux , and even fine-tuning, advanced commands and endless hot-keys will be found by typing man tmux .

')





A very good way to run tmux:

tmux attach || tmux new tmux attach || tmux new - by doing so, you first try to connect to an existing tmux server, if it exists; if this is not yet - create a new one.



After that you get to the full console.

Ctrl + bd - disconnect. (In the same way, you will disconnect if the connection is disconnected. How to connect back and continue working - see above.)



In one session there can be any number of windows:

Ctrl + bc - create a window;

Ctrl + b 0 ... 9 - go to such a window;

Ctrl + bp - go to the previous window;

Ctrl + bn - go to the next window;

Ctrl + bl - go to the previous active window (from which you switched to the current one);

Ctrl + b & - close the window (or you can just type exit in the terminal).



In one window there can be many panels:

Ctrl + b% - split the current panel into two, vertically;

Ctrl + b " - split the current panel into two, horizontally (this is a quotation mark, which is near Enter, not Shift + 2);

Ctrl + b → ← ↑ ↓ - move between panels;

Ctrl + bx - close the panel (or you can just type exit in the terminal).



Disadvantage - scrolling becomes unusual:

Ctrl + b PgUp - enter the "copy mode", then:

PgUp, PgDown - scrolling;

q - exit from "copy mode".

Source: https://habr.com/ru/post/126996/



All Articles