I frequently use the program nohup so that my processes are immune to hangups. So if I want to make the program program immune to hangups, I use the command
nohup program &
where & puts the process in the background.
When starting, nohup gives me the message:
nohup: appending output to `nohup.out'
Is there any way to send the output to a file other than nohup.out? Often I want to run many processes in the same directory using nohup, but if I do this, all the output gets lumped together in a single nohup.out file.
The manual page (for example, here) does not seem to have an option for specifying the log file. Can you please confirm this? Also, do you have any thoughts of how I can work around this problem?
nohup python file.py my_ouput.out &? – Charlie Parker Mar 05 '21 at 14:342>&1mean and why it works? – Charlie Parker Nov 12 '22 at 02:012>&1redirectsstderrtostdoutso when you usenohup myprogram > myprogram.out 2>&1bothstdoutandstderrwill be redirected tomyprogram.out– Edgar Magallon Nov 15 '22 at 01:34