Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have mac os 10.6. I want to search for a specific file on my machine. I am looking at it in finder, so I know it exists (foo.txt).

I type "foo.txt" into Spotlight, no results.

I type "foo.txt" into a finder window, no results.

I modify the search criteria in the finder window: [name, matches, "foo"]. No results.

How does one search for a specific file on a mac?

share|improve this question

2 Answers 2

Spotlight in Finder excludes system-related directories by default.

Use mdfind in Terminal to check if it is actually found by Spotlight, but just excluded from Finder's "user-friendly" results:

$ mdfind foo
/private/var/db/foo

Needless to say, /private/var/db is excluded from Spotlight search results when searching using the GUI


Make sure the volume your file is on is included in Spotlight. Check the Spotlight preference pane's exclusions, and mdutil -s mountpoint, e.g. mdutil -s / for the system disk:

$ mdutil -s /
/:
    Indexing enabled. 

You can enable displaying system files by selecting the criteria dropdown (where you select Kind etc.), then Other…. Search for System files, and check it to have it appear in the dropdown list. Whenever you search for system-related files, or want them included, make sure you add this criterion and select are included.

enter image description here

Alternatively, you can also use mdutil from the command-line, or a third party UI to it without filtering (HoudahSpot comes to mind, but I haven't used it), or use the locate command-line tool (and perhaps a GUI for it) once you initialize it using the instructions printed when it's not.

share|improve this answer

You appear to be doing things the right way -- Finder is probably best known method for this.

Is there a case-sensitivity option that's turned on? Is there a "rebuild indexes" type of option available in one of the menus?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.