Run a Bash Script in Background with No Output

Redirect the stdout and stderr to /dev/null to ignore the output and do not create the /root/nohup.out log file:

nohup /path/to/script.sh > /dev/null 2>&1 &

To save the stdout and stderr to the nohup.out file:

nohup /path/to/script.sh &

A similar article is:

Execute Commands After You Exit From a Shell Prompt

More Related Posts