Cannot figure out how to search for a file on mac os 10.6

0

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?

mark

Posted 2011-03-07T06:29:02.423

Reputation: 91

Answers

4

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.

Daniel Beck

Posted 2011-03-07T06:29:02.423

Reputation: 98 421

0

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?

Randolf Richardson

Posted 2011-03-07T06:29:02.423

Reputation: 14 002