Learn Termux a Terminal Multiplexer
Learn the best tool you can have on a non-GUI server or machine.
tmux
Installation
- Linux :
sudo apt-get install tmux
- Fedora :
sudo dnf -y install tmux
- Cent-OS :
sudo yum -y install tmux
- Arch Linux :
sudo pacman -S tmux
- to start :
tmux
- NOTE: Prefix key :
Ctrl+b
- github
What is tmux ??
- It is terminal multiplexer.
- It acts as a window manager in your terminal.
- It also allows to create multiple window and panes in a single terminal window.
What it can do
- Tmux keeps the sessions , windows and panes in a server located at
/tmp/tmux
- If your terminal window is crash or killed(detach) then still all your process and session is alive, until you kill the tmux server(reboot).
- Again you can pick the session from where you left by simply attaching to the session.
- tmux is also helpful while working with remote machine.
tmux key binds
NOTE: Prefix key C-b
== Ctrl+b
- to start :
tmux
- Splitting Pane :
- for left and right :
C-b+%
- for top and bottom :
C-b+"
- for left and right :
- Navigates through panes :
C-b+<arrow_keys
- to move left :
C-b ⬅
- to move right :
C-b âž¡
- to move up :
C-b ⬆
- to move down :
C-b ⬇
- Closing pane: type
exit
orC-b x
- Creating windows :
C-b c
- rename windows :
C-b ,
- to kill window :
C-b &
- rename windows :
- Navigates through windows :
- for previous window :
C-b p
- for next window :
C-b n
- for required :
C-b <number>
where number is number in front of the window’s name in your status bar
- for previous window :
- Session handling :
- to detach your current session :
C-b d
- for list of session to detach :
C-b D
- for list of session :
C-b s
- for list of session :
tmux ls
it worked without a tmux session - to attach to session from list :
tmux attach -t 0
-t 0
-t for specific target and 0 name of the session - attach to a new session :
tmux new -s database
new -s database
new for new , -s for session , database as name of sessionnew -w __
-w for new window - rename session :
C-b $
rename before starting the session :tmux rename-session -t 0 database
- for list of session :
- to detach your current session :
- to enter command prompt mode :
C-b :
NOTE : to see the more key bindings use C-b ?
- It will show the all binding available in it