Wednesday, January 27, 2010

Forgot to use screen or nohup on a command?

Let's say you run a command that is taking much longer to finish executing than you thought it would, and you have to go home. Here's what you do:

1. Press ctrl + z on the terminal to suspend the command.
2. Run: bg to move the last suspended program in the background
3. Run: jobs to list programs running on background
4. disown %1 to pick job #1, %2 if it's the second job on the list. This will mark the job so that SIGHUP is not sent to it if the shell receives a SIGHUP.

Note:
Thanks to my buddy John Eckersberg for showing me this today :-)

0 comments: