Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 865
Alexander Mills Avatar asked Mar 14 '26 00:03

Alexander Mills


1 Answers

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

like image 136
MTilsted Avatar answered Mar 15 '26 12:03

MTilsted



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!