In the last article, we looked at what Tmux is. Briefly, Terminal Multiplexer is a command-line utility for managing multiple terminals within a single window. It allows users to run multiple programs in a single terminal, split a terminal window into multiple panes, and group multiple panes in a single window.
Also tmux
allows the user to save terminal sessions and resume them at any time. Tmux
is very useful for managing remote servers and for creating more efficient multitasking environments in OS Linux. In this article, let's take a look at the syntax and some of the tool's options (not all of them, the most popular ones).
The Tmux
command has the following syntax:
tmux [options] [command]
Some of the most commonly used options of the Tmux
command are:
-c <path>
- specifies the path to the configuration file.-L <name>
- specifies the name of the socket.-f <
path> - specifies the path to the socket.-S <name>
- specifies the name of the session.The most commonly used Tmux
commands are:
new-session-
creates a new Tmux session.list-sessions-displays
alist of
current sessions.attach-session-
connects to the specified session.detach-session-
disconnects the current session from the shell.switch-
switches to another panel or window.kill-server-
stops all running sessions;kill-session-
terminates the session passed in the -t parameter;list-clients-
see the clients connected to the -t session;list-sessions
(ls
)- display alist of
all running sessions;rename-session-rename
a session, pass the session ID and a new name.Additional options and commands can be found by calling the Tmux
help with the command
man tmux
Or:
tmux -h
Next we will tell you how to use the command in practice.
To create a new session it is enough to execute the command without parameters:
tmux
You can also create a session with the new-session command and give it a convenient name:
tmux new-session -s "name"
Now you can use Tmux and create sessions with the command.