0
nohup command &> /dev/null &

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

2

1 Answer 1

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

2
  • Assuming that they are using bash, this is what they are doing.
    – Kusalananda
    Jun 27, 2019 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.
    – pizdelect
    Jun 27, 2019 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.