Keep work running with tmux
In this tutorial you will use tmux to keep a program running after you disconnect. By the end you'll be able to start a tmux session, leave it running, reconnect, and find your work exactly as you left it.
This matters because of how LINCOMM works. Normally, if your connection drops, anything you were running stops with it. tmux is a tool that keeps your programs running on the node even when you disconnect. That makes it essential for long jobs — and a good habit every time. Follow each step in order.
Before you start
- You are connected to a LINCOMM node and see a command prompt. If not, follow How to get connected to LINCOMM first.
- Note which node you are on. Run
hostnameif you're not sure. You'll need to return to the same node to reconnect. - About 15 minutes.
Step 1 — Start a tmux session
Start tmux:
tmuxYou should see a green status bar appear across the bottom of the screen. You are now inside a tmux session. Everything you run here will keep going even if you disconnect.
Step 2 — Start something that takes a while
Run a simple loop that prints a line every five seconds, so you have something to watch:
for i in $(seq 1 100); do echo "step $i"; sleep 5; doneYou should see step 1, then step 2, and so on, appearing one at a time. Leave it running and move to the next step.
Step 3 — Detach from the session
"Detaching" leaves the session running in the background and returns you to the normal prompt. Press Ctrl+B, let go, then press D.
You should see a message like [detached], the green status bar disappears, and you're back at your ordinary prompt. The loop is still running inside tmux — you just can't see it right now.
Step 4 — Confirm the session is still there
List your tmux sessions:
tmux lsYou should see one session listed, such as 0: 1 windows .... Your work is safe.
Step 5 — Reattach and find your work
Reconnect to the running session:
tmux attachYou should see the green status bar return and the loop still counting — it kept going the whole time. This is exactly what happens after a dropped connection, except that you detached on purpose.
Step 6 — Reconnecting after a real disconnect
If your internet connection actually drops while you're working, tmux protects you. To get back in:
- Connect to LINCOMM again, choosing the same node you were on (the one from "Before you start").
- Run
tmux attach.
Your session will be right where you left it. The same-node rule matters: a session lives on one node only, so connecting to a different node won't show it.
Step 7 — Finish up
When you're done, reattach if needed, then stop the loop by pressing Ctrl+C. To close the tmux session entirely, type:
exitThe status bar disappears and the session is gone. Running tmux ls now reports no server running, which is expected.
What you learned
You kept a program running through a disconnect and picked it back up. The key ideas were:
tmuxstarts a session;tmux attachrejoins one;tmux lslists them.- Detach with Ctrl+B, then D. Detaching leaves your work running.
- A tmux session lives on a single node, so reconnect to the same node to reach it.
- Start tmux every time you connect, so a dropped connection never costs you your work.
Next steps
- Start and watch long programs: How to manage jobs on LINCOMM.
- The recommended connection routine, including tmux: How to get connected to LINCOMM.