The tmux command

terminal multiplexer 13 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-v
Request verbose logging.

Subcommands in the examples

tmux attach
tmux ls
tmux split-window
tmux a
tmux kill-session
Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it.
tmux list-sessions
(alias: ls) List all sessions managed by the server. -F specifies the format of each line and -f a filter.
tmux new
tmux new-window
tmux rename-window
(alias: renamew) Rename the current window, or the window at target-window if specified, to new-name.
tmux select-window
(alias: selectw) Select the window at target-window. -l, -n and -p are equivalent to the last-window, next-window and previous-window…

Examples

tmux

Unnamed session

tmux new -s work

Named session "work"

tmux ls
tmux list-sessions
tmux attach -t work
tmux a -t work

Short form

tmux kill-session -t work
tmux new-window -n editor
tmux rename-window -t work:0 shell
tmux select-window -t 1
tmux split-window -h

Horizontal split (side by side)

tmux split-window -v

Vertical split (stacked)

tmux attach -t work -d

Attach here, detach any other client viewing it

Lessons that use tmux