how to use the unix “find” command to find all the cpp and h files?

后端 未结 6 1965
南笙
南笙 2021-02-01 03:18

I know that to find all the .h files I need to use:

find . -name \"*.h\"

but how to find all the .h AND .cpp

6条回答
  •  无人共我
    2021-02-01 03:49

    find . -name \*.h -print -o -name \*.cpp -print
    

    or

    find . \( -name \*.h -o -name \*.cpp \) -print
    

提交回复
热议问题