In this tutorial, let’s learn some basics of
tmux, to get started
What Is Tmux
Tmux is a window multiplexer, which allows you to have multiple terminal sessions within a single terminal window or to detach and reattach sessions.
To install tmux, just type the following command:
sudo apt install tmux (Debian based systems) sudo pacman -S tmux (Arch based systems) sudo dnf -y install tmux (Fedora)
After installation, just type
tmux to get started.
*- asterisk represents the current window.
0- window 0.
bash- name of the window.
To open a new window pane:
To open a window pane at the bottom:
To move in between panes:
Ctrl+b -> <- (left and right arrows on your keyboard)
To close the panes:
You can also have multiple windows. In order to open a new window,type the following command:
In order to edit a window name, use:
To switch between windows:
You can also have multiple sessions in tmux. When you start tmux, you start a tmux session. Sessions help you preserve the current state.
To start a new session, type the following command:
tmux new -s docker
To see what sessions are running or active:
You can also attach or detach sessions.
To attach a session:
tmux attach -t 0 Here, `-t` is target and `0` is the name of the session.
To detach a session:
You can also rename sessions.
tmux rename-session -t 0 git Here, we are renaming session `0` to `git`.
Finally, if you want to kill sessions, type the following command:
tmux kill-session -t git Here, `git` is the name of the session.
Follow me on other social media