0

I frequently use the commands like

find . ! -iname "*test*" -o -iname "*foo*" | xargs zgrep -ie first.*last -e last.*first

I use zgrep because it can grep through .gz files, and if the files aren't gzipped it simply uses grep. However I frequently get

gzip: copy.txt.gz: No such file or directory

logs that clutter the output of my searches. Is there any way to mute these gzip logs?

0

1 Answer 1

2

You can redirect the command standard error output to the null device.

find . ! -iname "*test*" -o -iname "*foo*" | xargs zgrep -ie first.*last -e last.*first 2>/dev/null 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .