Find all files matching 'name' on linux system, and search with them for 'text'

前端 未结 5 1506
猫巷女王i
猫巷女王i 2020-12-24 12:04

I need to find all instances of \'filename.ext\' on a linux system and see which ones contain the text \'lookingfor\'.

Is there a set of linux command line operation

5条回答
  •  梦毁少年i
    2020-12-24 12:50

    Go to respective directory and type the following command.

    find . -name "*.ext" | xargs grep 'lookingfor'

提交回复
热议问题