0
nohup command &> /dev/null &

This command still creates nohup.out file. Could you please help on how to avoid it?

fra-san
  • 10,205
  • 2
  • 22
  • 43

1 Answers1

2

&> is not POSIX standard. You need to use this syntax:

nohup command >/dev/null 2>&1 &

Related: Difference between 2>&-, 2>/dev/null, |&, &>/dev/null and >/dev/null 2>&1

dr_
  • 29,602
  • Assuming that they are using bash, this is what they are doing. – Kusalananda Jun 27 '19 at 10:09
  • 2
    @Kusalananda nohup should NOT create a nohup.out file when its stdout is not a tty. Moreover, nohup > /dev/null should be enough. The OP was probably bitten by the &> bashism (which will silently fail to redirect anything in other shells). This answer is right for that part. –  Jun 27 '19 at 10:17