Hacker News new | ask | show | jobs
by lefra 15 days ago
Before long-running commands, open a screen [1] session. That way, if you get disconnected, the job keeps running, and you can reconnect to the screen session afterwards.

The man page is quite long, use "screen -R <appropriate name" to create the session or reconnect to it, and (IIRC) CTRL-A D to exit screen without closing the session.

[1] https://man7.org/linux/man-pages/man1/screen.1.html

2 comments

Nowadays screen is considered legacy and it is recommended to use tmux, but the idea is the same.
systemd-run is more likely to be installed and another way of achieving this.
Can it work in interactive mode like screen and tmux?
It was my first time doing it. I didn’t know it’d be such a frustrating experience.