1

I read this question How to get the process ID to kill a nohup process? and the answer was great. However I need to ask if I write the "greater than" char twice in both cases like this

nohup my_command >> my.log 2>>&1 &

instead of

nohup my_command > my.log 2>&1 &

will it append to the same file instead of replacing it?

Thanks in advance

1 Answers1

3

Use nohup my_command >> my.log 2>&1 & to append the log files.

No need to change 2>&1 &,
2>&1 is ignore the stdin input.
Last & is to make your process background.

Ajay
  • 2,483
  • 2
  • 16
  • 27