The nohup command in Unix is used to run a command that will continue running even if the user logs out. The output is usually redirected to a file called nohup.out unless otherwise specified.
>Synopsis
nohup [command | output_file | & ...]
>Commands
command
Runs a specified command immune to hangups, allowing it to continue after logout.
Example:
-zsh
> nohup python3 my_script.py
Continues running my_script.py even if user logs out
[command] > output.log
Redirects output to a specified file instead of the default nohup.out.
Example:
-zsh
> nohup python3 my_script.py > output.log
Redirects output to output.log
[command] &
Runs a command in the background with no hangup.
Example:
-zsh
> nohup python3 my_script.py &
Runs my_script.py in the background, immune to hangups