There I said it !
Well, the source code is available. Fix it if you need it that bad.
Man, I have a minor inconvenience.
installs Gentoo
I agree. zgrep also works for uncompressed files, so we could use e.g.
zgrep ^
instead of zcat.Thanks, didn’t know that existed
That’s basically everything I was looking for !
Yeah, it’s a pain. Leads to bad one liners:
for i in $(ls); do zcat $i || cat $i; done
That’s really bad.
zcat ./* 2>/dev/null || cat ./*
does the same.Btw, don’t parse ls. Use
find |while read -r
instead.Thanks !
But still we shouldn’t have to resort to this !
Also, can’t get the output through pipefor i in $(ls); do zcat $i || cat $i; done | grep mysearchterm
this appears to workfind . -type f -print0 | xargs -0 -I{} sh -c 'zcat "{}" 2>/dev/null || cat "{}"' | grep "mysearchterm"
Still, that was a speed bump that I guess everyone dealing with mass compressed log files has to figure out on the fly because zcat can’t read uncompressed files ! argg !!!for i in $(ls); do zcat $i 2>/dev/null || cat $i; done | grep mysearchterm
zgrep . *
should do the trickoh, there’s also
zcat -f *
Celeste. Are you here? In a future search maybe?