How to: Run a shell script with nohup command

www.lau‮irutt‬.com
How to: Run a shell script with nohup command

To run a shell script using the nohup command, you can use the following steps:

  1. Open a terminal window on your Linux or Unix system.

  2. Navigate to the directory where the shell script is located using the cd command.

  3. Run the nohup command followed by the path to the shell script and any arguments that are needed, like this:

nohup /path/to/script.sh argument1 argument2 ...

Replace /path/to/script.sh with the path to the shell script, and argument1, argument2, etc. with any arguments that are needed.

  1. Press Enter to run the shell script with nohup. The nohup command will run the shell script in the background, and the terminal window will return to the command prompt.

The nohup command will redirect the standard output and standard error streams of the shell script to a file called nohup.out, which will be created in the current directory. You can view the output of the shell script by opening the nohup.out file in a text editor.

Created Time:2017-10-29 22:08:42  Author:lautturi