Recursively find all files that match a certain pattern

后端 未结 4 611
旧时难觅i
旧时难觅i 2020-12-13 05:44

I need to find (or more specifically, count) all files that match this pattern:

*/foo/*.doc

Where the first wildcard asterisk includes a variable number of s

4条回答
  •  渐次进展
    2020-12-13 06:38

    Based on the answers on this page on other pages I managed to put together the following, where a search is performed in the current folder and all others under it for all files that have the extension pdf, followed by a filtering for those that contain test_text on their title.

    find . -name "*.pdf" | grep test_text | wc -l
    

提交回复
热议问题