Whatever Whenever Tech insights, coding tips, and AI stuff
Home New Post
Profile
Login Register

Select a category for your post

Click tags to select/deselect

Markdown supported: # Heading, **bold**, *italic*, `code`, - list items, etc.
Tip: Paste images directly from clipboard or drag-and-drop to upload!

Basic tmux Commands

tmux keeps terminal sessions running in the background, even after you disconnect from SSH.

Start a new session

shell
tmux new -s work

The -s work option names the session. To start an unnamed session, run tmux.

List sessions

shell
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

shell
tmux attach -t work

Short form:

shell
tmux a -t work

Rename a session

shell
tmux rename-session -t work project

Remove a session

shell
tmux kill-session -t work

To remove all tmux sessions:

shell
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

shell
tmux new -s work
tmux ls
tmux attach -t work
tmux kill-session -t work
Cancel

Add New Category

Add New Tag

Home Search | RSS Sitemap

© 2026 whatever.asia