Show all sessions
sessions
// what it does
`tmux ls` (alias for `list-sessions`) prints every session on the server from the shell — one line each with name, window count, creation time, and whether it's attached. `Ctrl + b s` does the interactive equivalent from inside tmux: it opens a navigable tree (`choose-tree`) where you pick a session with the arrow keys and Enter to switch to it live. Use `ls` for scripting or a quick glance, `Ctrl + b s` for jumping between sessions.
// shortcut
Ctrl + bs
// shell
$ tmux ls$ tmux list-sessions// gotcha
`tmux ls` prints `no server running on /tmp/tmux-.../default` (exit code 1) when no server is up — that's an error, not an empty list, which matters in scripts. The `Ctrl + b s` binding only works while already attached inside tmux.