0

I can restrict Finder searching files by adding .noindex -extension, this thread. However, I want hide those files in Finder search.

How can you prevent Finder from showing .noindex -files?

3

There are a variety of ways to hide things in Mac OS X. Note: if you do any of these you most likely do not need to use the .noindex extensions since files hidden from the finder will not be typically be shown in Finder Spotlight searches.

  • chflags hidden fileToHide (as already mentioned) does this by setting OS X file attributes.
  • use the Unix style period at the start of a file name .fileToHide, of course this will hide the file from the Finder and the command line.
  • create a .hidden at the file system root and list the filenames of files to hide from the Finder. This was the way to do it in the first several versions of Mac OS X prior to the chflags method.
  • There is also a classic Mac OS 9 file attribute that can hide files, but this should be considered highly depreciated

Note that the various hiding methods and .noindex should all work on Folders too.

  • Awesome! I just switched to Zsh and did chflags hidden */.bak.noindex; chflags hidden */.new. Cleans up my spaces so much. I can now work normally creating bak files. They will just be hidden. I can unhide them when I need them. Thank you! – Léo Léopold Hertz 준영 Oct 8 '14 at 20:38
1

In the command line use:

chflags hidden fileToHide

To show files again chflags nohidden ...

You must log in to answer this question.

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