Yeah I realize that, but find is a stronger tool for the use case because it also allows wildcards to be specified in the name.
>your "find" will search in and below
Your "mdfind" will also search in and below the current directory.
find also has -depth which can be used to tell it to search only this directory.
mdfind has -onlyin to tell it what directory to search in, but it still recurses down. Does it have an option to limit this? Please do tell.
>for files that exactly match "somestring"
Well find also allows wildcards though. So not necessarily exactly… somestring is just an example.
Does mdfind allow wildcards?
Also find is fun to combine with grep to inspect file contents, especially since it has the -print0 option…
find . -type f -name "*.py" -print0 | xargs -0 grep somestring
`find . -type f -name \*.py -exec grep homestring {} \;`
Yeah I realize that, but find is a stronger tool for the use case because it also allows wildcards to be specified in the name.
>your "find" will search in and below
Your "mdfind" will also search in and below the current directory.
find also has -depth which can be used to tell it to search only this directory.
mdfind has -onlyin to tell it what directory to search in, but it still recurses down. Does it have an option to limit this? Please do tell.
>for files that exactly match "somestring"
Well find also allows wildcards though. So not necessarily exactly… somestring is just an example.
Does mdfind allow wildcards?
Also find is fun to combine with grep to inspect file contents, especially since it has the -print0 option…
Please tell me how to do this with mdfind, I would love to know!