To list all tmux sessions, use the command tmux list-sessions
or its shorthand tmux ls
.
$ tmux ls
Listing tmux sessions allows you to see all active sessions, their names, and status information. This is particularly useful when you have multiple detached sessions and need to identify which one to attach to.
tmux list-sessions
- Full commandtmux ls
- Shortened version of the commandCtrl+b s
- Shows interactive session list0: 1 windows (created Fri May 31 12:34:56 2025) [80x24] 1: 3 windows (created Fri May 31 13:45:12 2025) [80x24] (attached) dev: 2 windows (created Fri May 31 14:10:34 2025) [80x24]
The output shows:
tmux attach -t 0
- Attach to session number 0tmux attach -t dev
- Attach to session named "dev" To create a named session, use tmux new -s session-name
. Named sessions are easier to identify than numbered ones.
When inside tmux, press Ctrl+b s
to show an interactive list of sessions. Use arrow keys to select a session, then press Enter to switch to it.