Basic tmux Commands for Terminal Sessions
Basic tmux Commands
tmux keeps terminal sessions running in the background, even after you disconnect from SSH.
Start a new session
tmux new -s work
The -s work option names the session. To start an unnamed session, run tmux.
List sessions
tmux ls
Detach from a session
Press Ctrl + b, then press d to detach and put the session in the background. Any programs inside it keep running.
Reattach to a session
tmux attach -t work
Short form:
tmux a -t work
Rename a session
tmux rename-session -t work project
Remove a session
tmux kill-session -t work
To remove all tmux sessions:
tmux kill-server
Inside a session, run exit to close the current shell. If it is the last shell, tmux removes the session.
Quick workflow
tmux new -s work
tmux ls
tmux attach -t work
tmux kill-session -t work
Share this post
Related Posts
Linux Commands Cheat Sheet
Linux commands cheat sheet: comprehensive reference covering basic commands, man pages, and help options.
Linux Commands Use Cases
Linux commands: zip/unzip operations, kernel version checking, GUI system control, head/tail file viewing.
How to install custom fonts on Linux
Install custom fonts on Linux: fc-list command, OTF/TTF file installation, font cache updates, verification steps.
Deploy Django on Ubuntu with Caddy && Gunicorn
Django deployment on Ubuntu with Caddy and Gunicorn: Gunicorn installation, worker configuration, Caddy reverse proxy.