Nohup is short for “No Hangups.” It’s not a command that you run by itself. Nohup is a supplemental command that tells the Linux system not to stop another command once it has started. That means it’ll keep running until it’s done, even if the user that started it logs out. The syntax for nohup is simple and looks something like this:
nohup ./your-script.sh &
Because nohup can keep running independently of the user that started it, the command needs somewhere to output any messages or errors. Since there isn’t a terminal to associate with it, nohup logs everything to an output file, nohup.out.
By default, that file is located in whichever directory you started the command in.
You can have your predefined file to log this output. The syntax would be like
nohup ./your-script.sh >> /pathto/your/dir/myscriptoutput.log &