Running Ubuntu Linux and am starting an application process from my terminal window. The problem is, that window is then basically locked, not allowing me to execute more commands while the spawned application is running. To fix this, I found this command, where I basically add a & to the end of the line.

~/tools/shell/mycommand &

This allows me to execute the command and gives me back access to the command prompt to execute more commands.

So the next issue I have is, if I close that terminal window, all processes that were spawned from that window are instantly killed. No warnings, pleases or thank-yous. That’s scary for those of us that don’t save often. Ah, but there are more solutions. After executing the command, as shown above, simple execute the following command, and it will separate spawned processes from that terminal window.


Or, simpler yet, why not just kick the application off from in an independent process, right from the beginning, with this util-linux command.

setsid ~/tools/shell/mycommand