osx - bash: recursively find all files that match a certain pattern -
I need to find (or more specifically, count) all the files that match this method:
* / foo / * Doc
Where the first wildcard star contains a variable number of subdirectories
You can use regex with GNU, which match the entire path (as opposed to Just to calculate the number of files: ( I do not know if it will work on OSX, though. -name ):
find -reggets'. * / Foo / [^ /] *. Doc '
find -reggets'. * / Foo / [^ /] *. Doctor '-printf'% i \ n '| Wc -l
% i format code
find to print the inode number instead of the file code), the filename In contrast, the inode number is guaranteed that there is not a new line like letters, so the count is more reliable. Thanks for the @Tripple for the suggestion.)
Comments
Post a Comment