tmux 3 cheatsheet

tmux 3: Sessions

9 common tmux 3 tasks.

Start a named session

Create a new session called work.

tmux new -s work

List sessions

Show the running sessions.

tmux ls

Attach to a session

Reconnect to a running session.

tmux attach -t work

Detach from the session

Leave tmux running in the background. Press the prefix, then d.

Ctrl-b d

Switch sessions

Choose a session from an interactive list.

Ctrl-b s

Rename the session

Change the current session's name.

Ctrl-b $

Run a command in a background session

Start a session that runs a command without attaching to it.

tmux new -d -s build 'make all'

Kill a session

End a session and everything running in it.

tmux kill-session -t work

Caution: Kills every program running in that session.

Kill all sessions

Stop the tmux server and every session.

tmux kill-server

Caution: Kills every session and every program running in them.

Was this page helpful?