How to Run a Detached Process in Bash

Running a process that is detached from the terminal is sometimes useful. Case in point, I had to run a database update script remotely via SSH. However, the update script takes a long time (close to an hour) so running it over SSH wouldn’t be practical. Simply being disconnected with the the remote host will cause the script to prematurely end. So, in order to execute the script in its entirety without interruption, just run the following command:

sudo nohup php update_script.php &