Tmux common commands
- Horizontal pane => control b + %
- Switch between panes => control b + arrow (↑、↓、←、→)
- Vertical pane=> control b + “
- Close pane => control d
- New window => control b + c
- * on the bottom sidebar => Current
- Rename window => Control b + ,
- Go to specific window => control b + number (ex. 0, 1, 2, 3…. )
- Close panes or windows => Type exit
- Detach the session => control b + d (Back to normal terminal)
- View the tmux sessions run in the background => tmux ls
(Give you a summary of how many windows you have open within that tmux session and when it was created) - Reattach tmux session => tmux attach -t [the name of the session]
- `1: 2 windows (created Mon Dec 28 11:28:16 2020) (attached)`
tmux rename-session -t 0 git (this will rename session 0 to git) - Give the session a name before going into the session
- tmux new -s docker
- Deleting or killing sessions
tmux kill-session -t 0
The power of using tmux => Session
- Preserve your state or process whatever you run in that windows or in that sessions
- In case, you lose the connection you only lose it on the tmux session instead of the backgrounds