Linux: nohup without output

This  returns output like this: "[1] 23936"
nohup doSomething >/dev/null &

Open in new window


How can I do this without any output?
LVL 16
hankknightAsked:
Who is Participating?
 
Kerem ERSOYConnect With a Mentor PresidentCommented:
Hi,

The output comes from the OS not the command because "&" causes the command to be executed in background. One way to avoid this is to run it from within another shell such as:

bash -c "nohup doSomething &" > /dev/null

Cheers,
K.
0
 
pritamduttCommented:
The usage of  & symbol causes this job to run in background which causes the program to return the PID assigned to it

change the command to
nohup doSomething >/dev/null & > /dev/null

an try.


hope this helps!
0
 
hankknightAuthor Commented:
That does not work.  Try it:
nohup ls >/dev/null & > /dev/null

Open in new window

0
 
pritamduttConnect With a Mentor Commented:
I only get a message nohup: ignoring input and appending output to 'nohup.out'

I tried
1. nohup ls -lR & > /dev/null
2. nohup ls -lR > /dev/null & > /dev/null

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.