What Is tmux?
tmux is a terminal multiplexer. It lets us use a single environment to launch multiple terminals, or windows, each running its own process or program.
$ brew install tmux
$ sudo apt-get install tmux
Creating named session which can be used we want the session to run the background
$ tmux new-session -s session-name OR $ tmux new -s session-name
Command Prefix : CRTL-b is way of telling the next command is for tmux and not the application its running
In normal terminal if we close the terminal all the session would expire whereas in tmux its not the case.
Any program we start in session will be running .
We can see the list of tmux sessions running
$ tmux list-sessions OR $ tmux ls (if no name is provided the list session is named by numbers)
Detaching from the session using
We attach back to the session
$ tmux attach (if only one session is running) $ tmux attach -t session-name
We can kill the session by
$ exit (within the tmux session ) OR $ tmux kill-session -t session-name
It ask for confirmation before killing the window
Creating a new window
Renaming window from default name , default name of the window will be the application its running
To navigate around the windows windows using
CRTL-b n (next) CRTL-b p (previous) CRTL-b 0-9 (if you have more the windows) CRTL-b f (to find the window by its name ) CRTL-b w (dsiplays visual menu of windows and you can select them)
Panes : In Tmux we can divide a single session in
We can navigate around the window using
CRTL-b o OR CRTL-b arrow keys (UP , DOWN , LEFT , RIGHT)