0
nohup command &> /dev/null &

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

fra-san
  • 9,931
  • 2
  • 21
  • 42
anilkumar
  • 1
  • 1

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_
  • 28,763
  • 21
  • 89
  • 133
  • 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