Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jsx97

macrumors member
Original poster
Dec 6, 2022
39
8
I have completely re-wrote the post. The original version is now at the very bottom.

* * *

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:

Code:
~/
|- 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).

1741867738759.png


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).

1741867747636.png


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).

1741867758113.png


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.

Original post​


I have created the following saved search and for some reason the "File visibility" line makes the search show "nothing". In other words, if I remove the "File visibility" line, the search works correctly: it shows me the files that are modified today. But with the "File visibility" line, there are zero files.

1741857478660.png


What is wrong here? How can I fix it?
 
Last edited:
  • Like
Reactions: BrianBaughn
It's a bug, I assume. Some sort of coding error probably.

I had noticed recently that some of my searches weren't getting results and I think it's for the same reason…the "visibility" search condition. I had to resort to a different search method.
 
  • Like
Reactions: jsx97
It's a bug, I assume. Some sort of coding error probably.

I had noticed recently that some of my searches weren't getting results and I think it's for the same reason…the "visibility" search condition. I had to resort to a different search method.

FWIW I have completely re-wrote the post. The original version is now at the very bottom.
 
Files/folders with leading dot:
As the answer to https://apple.stackexchange.com/questions/479021/searching-for-hidden-and-system-files-in-finder says, they are not indexed by Spotlight and so can't appear in searches using the Spotlight index. And this probably applies to all files inside a dot folder.

Test1 (with hidden flag): I suspect there is a bug with the "file visibility" in Finder search.

usr/local/bin: I can't reproduce your issue. Finder successfully finds files in there.
 
See the correction to my post.

Are you sure you corrected your post? I do not see any changes.

I have found a discussion on Reddit (reddit.com/r/MacOS/comments/10n7b4k/) in which people complain "System files" criteria stopped working since Monterey. I myself use Sequoia (15.3.2).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.