Searching for hidden and system files in Finder

Folks, does anybody understand how the Finder (= Spotlight) search really works?

Test 1

I have created the following test files and folders in my $HOME:

~/
|- test0/           - regular folder
   |- test1.txt     - hidden with `chflags hidden test1.txt`
   |- .test2.txt    - dot file
   |- .test3/       - dot folder
      |- test4.txt  - regular file

If I open Finder and look for test, the test1.txt file is successfully found (despite it is hidden!) without any tweaks (fig. 1).

fig1

But there is no way — at least, I didn’t figured it out myself yet — to show .test2.txt, .test3 and test4.txt. At first glance, the solution is easy: click a search criteria, select “Other”, there enable the “File invisible” check box, then add it as a new criteria (fig. 2).

But this doesn’t help. And even worse, even test1.txt is not found then. In fact, this option seems to broke any search — no matter which files you tried to search, the search won’t find anything.

Test 2

I have a test file called foo in my /usr/local/bin. Finder cannot find it, even if (the same as the second step in Test 1) I will add “System files” criteria (fig. 3).

image

Questions

  • Q1: Does it work the same for you?
  • Q2: Is it a known bug? If “yes”, could you provide a link?
  • Q3: Is there a fix or workaround for this? I’m not afraid of using command line.

Thanks in advance!

Yes I know about third-party search utilis. Please don’t mention them, let’s keep this topic focused.

You might want to take a look at the Eclectic Light Company and search for spotlight. He has many articles there. Here is one:

I have read all of them. He don’t address the issues I have asked here.

1 Like

No. :slight_smile:

I’m pretty sure you can’t get Spotlight to index dotfiles, unfortunately. And there’s no way to Finder search without using the Spotlight index unless you use a third party utility.

One the rare occasions that I need to find dot files by content I kick of a Terminal then use a shell command with find and grep but then I’m used to piping/using Unix commands together to get exactly what I want.

1 Like

Spotlight has been disappointing Mac users longer than Siri.

If I really want to find something, I rarely use Spotlight after my first attempt (which usually doesn’t find it).

After that I might use find but I’ll also use EasyFind, a free app from DevonTechnologies:

EasyFind Screenshot

I’d be very surprised if EasyFind doesn’t find what you’re looking for.

3 Likes