nohup
nohup runs background process(es) uninterruptedly even the remote SSH session goes offline.
nohup mycmd &
Output¶
The output will be in nohup.out
by default. If you want to customize the output location, just redirect it:
nohup mycmd &> log.txt &
You can also lower the priority for the background process
nohup nice mycmd &
End the running process¶
When you're done, you can kill the process by the process ID (PID).
ps -aux | grep mycmd
kill PID