Happens to me all the time, I start something that takes too long, and I think “I wish i had started that in screen”… So here is a quick reference guide:
- Suspend the process with Ctrl+Z.
- Resume the process in the background with bg.
- Disown the process with disown %1.
- Launch a screen session with screen.
- Find the PID of the process using pgrep.
- Use reptyr to take over the process reptyr.