The main purpose for me to use tmux is to keep my program running even if I close the terminal.

Basic Usage Link to this heading

Command Description
tmux Start a new session
tmux new -s <session-name> Start a new session with name
tmux ls List all sessions
tmux kill-session -t <session-name> Kill a session
tmux attach -t <session-name> Attach to a session
tmux detach Detach from a session

Other Commands Link to this heading

Command Description
tmux rename-session -t <old-name> <new-name> Rename a session
tmux switch -t <session-name> Switch to a session
tmux a Attach to the last session
tmux list-keys List all key bindings
tmux list-commands List all commands and their arguments
tmux info Show information about the current session

Installation Link to this heading

On Ubuntu, you can install tmux using the following command:

bash
1sudo apt install tmux

Reference Link to this heading