grep, but only certain file extensions

前端 未结 12 2512
野性不改
野性不改 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

    How about:

    find . -name '*.h' -o -name '*.cpp' -exec grep "CP_Image" {} \; -print
    

提交回复
热议问题