Sometimes you just need to let a process run, and walk away, or sleep.
I recently had to perform a long-running task on a remote server over SSH. The kind of task where you start it, and then… you wait. Could be minutes, could be hours. And if your SSH connection drops, because your laptop goes to sleep, your Wi-Fi hiccups, or life just happens, the process dies with it. All that progress, gone.
That is exactly the situation where tmux earns its place in your toolkit.
tmux is a terminal multiplexer. In plain language: it keeps a session alive on the server, completely independent of your SSH connection. YLearn why tmux is the perfect tool for running long SSH tasks without worrying about dropped connections or lost progress.ou attach to it when you connect, start your task, then detach and disconnect. The session keeps running on the server, unbothered. When you reconnect, from the same machine, a different one, or even your phone, you just attach again and pick up right where you left off.
For my task, the workflow was simple:
- SSH into the server
- Start a new tmux session with
tmux new -s cleanup - Run the long-running command
- Detach from the session and close the terminal
- Come back later, SSH in again, reattach (
tmux attach -t cleanup), and check the results.
No more anxiety about a dropped connection ruining hours of work.
If you work with remote servers regularly, tmux is one of those tools you do not realize you needed until you use it once. After that, you wonder how you managed without it.
I am only scratching the surface here of all possibilities tmux has to offer, but for this use case alone, it’s a life saver.
Photo by Ilnur



Leave a Reply