tmux flags & options

new-session

Create a new tmux session.

tmux new-session -s mysession

-t, target session

Specify a target session, window, or pane.

tmux attach -t mysession
tmux kill-session -t mysession

attach

Attach to an existing session.

tmux attach
tmux attach -t mysession

detach

Detach from the current session (keyboard shortcut: Ctrl-b d).

tmux detach

-d, detach others

Detach other clients when attaching to a session.

tmux attach -d -t mysession

list-sessions

List all active sessions.

tmux list-sessions
tmux ls

kill-session

Destroy a session.

tmux kill-session -t mysession
tmux kill-server

split-window

Split the current pane into two.

tmux split-window -h
tmux split-window -v

send-keys

Send keystrokes to a pane.

tmux send-keys -t mysession "ls -la" Enter

select-pane

Switch focus to another pane.

tmux select-pane -t 0
tmux select-pane -L