grep, but only certain file extensions

前端 未结 12 2518
野性不改
野性不改 2020-12-02 03:18

I am working on writing some scripts to grep certain directories, but these directories contain all sorts of file types.

I want to grep jus

12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 04:04

    The easiest way is

    find . -type  f -name '*.extension' | xargs grep -i string 
    

提交回复
热议问题