tmux
tmux
install
sudo apt update && sudo apt install tmuxcheck if it works:
tmuxusage
common commands
prefix (start of commands) -> CTRL+b
Ctrl+b + D - detach from the current tmux session
Ctrl+b + % - split window horizontally
Ctrl+b + " - split window vertically
Ctrl+b + arrow key (left right, up, down) - move around between the window panes
Ctrl+b + x - close the current pane
Ctrl+b + c - create a new window
Ctrl+b + n - move to next window
Ctrl+b + p - move to previous window
Ctrl+B + : - command line with tab completion
Ctrl+b + ? - view keybindings (press q to quit)
ctrl+b + w - navigation panel
Ctrl+B : — Enter the command line to type commands. Tab completion is available. Ctrl+B ? — View all keybindings. Press Q to exit. Ctrl+B W — Open a panel to navigate across windows in multiple sessions.
example
Start a new tmux session with a name:
tmux new -s huntingStart a long-running process then you can detach from it to keep it running.
i=0; while true; do echo "Test process $i"; let i=i+1; sleep 10; doneprefix command:
Ctrl+b
detach command (after prefix):
d
list active tmux sessions:
tmux lsYou should be safe to disconnect from your ssh session.
To get back to the long-running process...
tmux lsview the session from the list by attaching to it by name or number:
tmux attach -t huntingto cancel:
Ctrl+c
Last updated
Was this helpful?