What expands to all files in current directory recursively?

前端 未结 5 1295
無奈伤痛
無奈伤痛 2020-11-27 13:32

I know **/*.ext expands to all files in all subdirectories matching *.ext, but what is a similar expansion that includes all such files in the

5条回答
  •  独厮守ぢ
    2020-11-27 14:03

    $ find . -type f
    

    That will list all of the files in the current directory. You can then do some other command on the output using -exec

    $find . -type f -exec grep "foo" {} \;
    

    That will grep each file from the find for the string "foo".

提交回复
热议问题