Home

tmux,a terminal multiplexer

Introduction

Installation

Common usage

up

Introduction

tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.Github Link

up

Installation

On Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux:

sudo dnf install tmux

up

Common usage

Start a new session
      tmux
      tmux new
      tmux new-session
      :new
      
Start a new session with the name "session-name"
      tmux new -s session-name
      :new -s session-name
      
Start a new session with the name "session-name", if the name already exists, attach it.
      tmux new -A -s session-name
      :new -A -s session-name
      
Start a new session named "session-name" without attaching it.
      tmux new -s session-name -d
      :new -s session-name -d
      
attach to the last session
      tmux a
      tmux at
      tmux attach
      tmux attach-session
      
attach to "session-name"
      tmux a -t session-name
      tmux attach-session -t session-name
      :a -t session-name
      
List all active sessions
      tmux list-sessions
      tmux ls
      :ls
      
Switch to another session
      :switch -t [session-name-or-id]
      
List all sessions, then choose one.
Press "Ctrl+b", then press the "s" key, now use the arrow keys and enter to choose.
Kill the current session
Press "Ctrl+d", or
      :kill-session
      :kill-session -t [current-session-name-or-id]
      
Kill the specified session
      :kill-session -t [session-name-or-id]
      
Detach from current session
Press "Ctrl+b" and then press "d".