Tmux is a "terminal multiplexer" that makes it much easier to run multiple programs over a single ssh session. It lets you create multiple virtual terminals within a single ssh login, allowing you to easily flip between each virtual terminal. Each virtual terminal works like a regular terminal but has the added benefit that if you lose the overall ssh session you can log back in and re-attach to the tmux session and all your virtual terminals are still there where you left off. This also allows you to start one or more programs within virtual terminals, detach the tmux session, logout your ssh session, login via ssh a some point in the future, re-attach to your tmux session, and all your previous virtual terminals are exactly where you left off. Programs you run in virtual terminals continue to run while you're detached and/or while you're logged out all-together.
Shell cmd | Action |
---|---|
tmux | Start tmux |
tmux ls | Show existing tmux sessions |
tmux attach | Re-attach to last active |