find string inside a gzipped file in a folder

前端 未结 7 1543
野性不改
野性不改 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 17:57

    zgrep "string" ./*/*

    You can use above command to search for string in .gz files of dir directory where dir has following sub-directories structure:

    /dir
        /childDir1
                  /file1.gz
                  /file2.gz
        /childDir2
                  /file3.gz
                  /file4.gz
        /childDir3
                  /file5.gz
                  /file6.gz
    

提交回复
热议问题