find string inside a gzipped file in a folder

前端 未结 7 1544
野性不改
野性不改 2020-12-13 17:26

My current problem is that I have around 10 folders, which contain gzipped files (around on an average 5 each). This makes it 50 files to open and look at.

Is there

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 17:54

    how zgrep don't support -R

    I think the solution of "Nietzche-jou" could be a better answer, but I would add the option -H to show the file name something like this

    find . -name "*.gz" -exec zgrep -H 'PATTERN' \{\} \;
    

提交回复
热议问题