Methods of payment Abuse

Syntax and options of the Tmux command

27.05.2023, 18:21

In the last article, we looked at what Tmux is. In short, Terminal Multiplexer is a command-line utility for In the last article we looked at what Tmux is. In short, Terminal Multiplexer is a command-line utility for managing multiple terminals within a single window. It allows users to run multiple programs in one terminal, split a terminal window into multiple panels, and group multiple panels in one window.

tmux also 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 Linux OS. In this article, we will look at the syntax and some options of the tool (not all, the most popular).

Tmux syntax

The Tmux command has the following syntax:

tmux [options] [command]

Tmux Options

Some of the most commonly used options of the Tmux command are:

  1. -c <path> - specifies the path to the configuration file.
    -L <name> - sets the socket name.
    -f <path> - specifies the path to the socket.
    -S <name> - sets the session name.

Tmux Commands

The most commonly used Tmux commands:

  1. new-session - creates a new Tmux session.
  2. list-sessions - displays a list of current sessions.
  3. attach-session - connects to the specified session.
  4. detach-session - disconnects the current session from the shell.
  5. switch - switches to another panel or window.
  6. kill-server - stop all running sessions;
  7. kill-session - terminate the session passed in the -t parameter;
  8. list-clients - view clients connected to the -t session;
  9. list-sessions (ls) - list all running sessions;
  10. rename-session - rename the session, you need to pass the session ID and a new name.

Additional options and commands can be found by calling Tmux help with the command

man tmux

Or:

tmux -h

Next, we will tell you how to use the command in practice.

Tmux Application

To create a new session, just run 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.multiple terminals within a single window