Saturday, October 14, 2006

Better locate with mdfind

I wanted a way to search for the name of a file locate style but using mdfind. mdfind finds files with the search term in any way associated with the file. I created this little script called mdf, did a chmod +x and placed it on my path:

mdfind "kMDItemDisplayName == $1"

Now I can find files by doing: $ mdf filename

It's better than locate because spotlight is updated live.

No comments: