Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Search current directory using an mdfind alias' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Search current directory using an mdfind alias
Authored by: bdm on Aug 25, '05 09:58:38AM
The -onlyin parameter of mdfind does not obey the usual conventions for Unix commands. For example, you can't write mdfind -onlyin . to search the current directory. You can also specify non-existent directories and still get output (try it). The man page doesn't mention any of this.

[ Reply to This | # ]
Full directory path?
Authored by: lullabud on Aug 25, '05 02:29:57PM

You're right, it seems to require a full directory path. That's very odd... Hopefully that'll be fixed soon.



[ Reply to This | # ]
More generalized version
Authored by: ferret-slayer on Mar 08, '06 08:43:38AM

[robg adds: If you're using tcsh, the format will be slightly different: alias spot 'mdfind -onlyin `pwd`'. I tested this one, and it works quite nicely.]

This doesn't work if any directory or disk in the path has a space in the name. A more generalized version would be:

alias spot 'mdfind -onlyin "`pwd`"'



[ Reply to This | # ]