Alexander Mills Alexander Mills - 10 days ago 4
Node.js Question

Redirect only stdout to /dev/null

I haven't yet mastered the weird shell stdio redirection thing yet.

I want to run npm install but redirect stdout so I don't have to see all of that. (I still want to capture stderr in the terminal, I just don't want to see stdout).

npm install -D suman 1> /dev/null


This doesn't seem to work.

What is the correct syntax (and possibly, why) to use to only redirect stdout to
/dev/null
?

Answer

npm install -D suman > /dev/null should do it. (It is standard for the redirect, only to redirect stdout)

Comments