0

I have many gzipped files and I am trying to find some string pattern from the thousands of file but I am getting extra .gz while trying to zgrep it. Please refer the below, could you please advise. Thanks.

$ zcat abc.gz
1234^911^is^good
this^is^test

$ ls *.gz| xargs zgrep 911
gzip: abc.gz.gz: No such file or directory

Edit 1: @waltinator, thank you. In the echo it is showing the correct stuff.

$ ls *.gz| xargs echo zgrep 911
zgrep 911 abc.gz
$ ls *.gz| xargs zgrep 911
gzip: abc.gz.gz: No such file or directory

Edit2: find is giving the correct output

$ find . -name *.gz | xargs zgrep 911
1234^911^is^good
Forever Learner
  • 729
  • 1
  • 10
  • 17

0 Answers0