find string inside a gzipped file in a folder

前端 未结 7 1506
野性不改
野性不改 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条回答
  • 2020-12-13 18:09

    use the find command

    find . -name "*.gz" -exec zcat "{}" + |grep "test"
    

    or try using the recursive option (-r) of zcat

    0 讨论(0)
提交回复
热议问题