0

I have excluded a folder from Spotlight, because this folder has a lot of files so it often fills up the results, no matter what I'm searching for.

However, sometimes I still want to search this folder. So, I tried opening the folder in Finder, then searching using the box in the top-right corner of the window, then selecting Search: "Folder_name" to limit the results to just that folder.

This method does not show any results, however. I assume it's because the folder is excluded from Spotlight search. So, is there any way that I can perform a manual search on the folder still, whenever necessary?

4
  • I'm not quite familiar with Spotlight's inner workings, but I think it indexes the folder even if it is excluded, just doesn't show any results from it. So if you turned the exclusion off, maybe it works. If it doesn't, you can use mdimport on the Terminal to create an index, and may get rid of it after your search with another CLI tool. If you search for file names or content of text files only, there are also solutions involving the grep and find CLI utilities, or maybe even some GUI applications. Jul 20, 2013 at 20:01
  • Are you trying to search by name/date or by content?
    – nohillside
    Jul 20, 2013 at 20:14
  • Search by filename, that's usually all I need.
    – Gary
    Jul 20, 2013 at 21:18
  • Then you may want to use EasyFind, which also has an English interface, or use find/grep on the Terminal. Jul 20, 2013 at 22:37

3 Answers 3

1

If you're happy with the terminal you can use the find command.

Something like opening Terminal in Utilities.

cd <folder name>
find . -name <whatever you're searching for>

Once found you can open it up with open

So, I can do something like:

alex@smiley:~|⇒  cd Desktop
alex@smiley:~/Desktop|⇒  find . -name Mac*
./Mac Pro.spx
alex@smiley:~/Desktop|⇒  open Mac\ Pro.spx

Notice that I used the * as a wildcard to match all files starting with Mac

0

Using terminal, you could use locate:

locate MY_FILE

Normally, the locate's database is update periodically (see man locate).

But you can run (if database is not up-to-date):

sudo /usr/libexec/locate.updatedb

0

Spotlight let’s you exclude results quite easily using regex like syntax and SQL like syntax. Why not craft a smarter search and let it index this folder?

You can drop a newer index file in it and remove that file when you wish to include results as well. Pretty low impact since you’re about to index that folder one way or another and Spotlight is very efficient in my experience.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .