Silence curl with >/dev/null 2>&1 when it’s piped

curlpipe

So I have a curl that is piped to a grep and a sed.
Where would I apply the >/dev/null 2>&1 ?

curl www.site.com | grep stuff | sed "other stuff"

At the very end or after the curl?

Best Answer

Please be more specific what is the purpose of the command. I guess you want to use

curl -s www.site.com

to prevent the progress indication and other stuff. -s will perform the same action but silently

If you absolutely have to use >/dev/null 2>&1 i think i would redirect curl output to the file

curl www.site.com -o file.txt >/dev/null 2>&1
cat file.txt | grep stuff | sed "other stuff"   
Related Question