5

Is there a way to tell Apple's content indexer to ignore a folder and its children by creating a file (similar to robots.txt) in the root of the folder to be ignored?

I don't want the folder to be listed in the privacy pane of system preferences since that's the first place someone who knows would go to look for "private" files.

Benefits of NOT using the system-preference panel:

  • More transportable - an ignore setting in an external drive that moves between computers would be easier to maintain
  • More private - listing a file to be ignored in a preference panel is hardly private

Is there a way to use a (slightly-more-stealthy .spotlight) settings file?

** edit **

Yes, I realize that this isn't a perfect solution, but it's good enough for my purposes.

  • 4
    possible duplicate of How can I make spotlight ignore certain file types and directories? – D.W. Sep 21 '15 at 18:51
  • @D.W. I'm voting to keep this open. The linked question is great for the typical - I'm OK with the GUI but this focuses on alternative manners. Merging them would seem bad to me on first look. – bmike Sep 21 '15 at 20:11
  • @bmike, I'm not following what you mean by "alternative manners". Can you elaborate? Don't the answers there answer this question? Isn't that the definition of a duplicate? Anyway, in the grand scheme of things it's obviously not a big deal, but I personally don't understand the reasoning at the moment. – D.W. Sep 21 '15 at 20:29
  • @D.W. Like it says - anything but the top voted/accepted answer in the other question is "alternate means" – bmike Sep 21 '15 at 20:57
  • Security by (even more) obscurity, much? Spotlight is the least of your concerns when somebody wants to look for hidden files… – bjb568 Sep 22 '15 at 0:26
8

This answer to How can I make spotlight ignore certain file types and directories? appears have the solution:

$ cd DIRECTORY
$ touch .metadata_never_index
5

Rename the containing folder to end with .noindex

2

You can tell Spotlight to ignore a folder, but not by creating a file. In the System Preferences Spotlight pane select the Privacy tab and add the folder to the list of folders to not be indexed.

  • 1
    I'm aware of this. If you list the folder in the local, then it's not very private. – craig Sep 21 '15 at 15:25
  • 1
    @craig, of course, if people are already on your system and trying to find your hidden files, I would think that running find . -type f \( -name "*.metadata_never_index" \) would only be marginally harder than digging into the spotlight preferences privacy tab. – KyleMit Sep 21 '15 at 18:48

You must log in to answer this question.

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