I am trying to find a way to make my mac see .dSYM files as hidden. I know I could do:

chflags hidden / -name *.dSYM

but the next time I create a .dSYM file it wont be hidden. There must be a way to tell finder to hide a certain file type (all currently on my machine, plus all that I will create in the future).

I am assuming that just because it is hidden, it wont affect my ability to use the .dSYM files when I am running cgdb in terminal? Or do the have to be not hidden for cgdb to be able to find them?

(I am on Mountain Lion)

  • There isn't a direct way to do this. If the .dSYM files only occur in a few folders, Folder Actions might be an option.
    – nohillside
    Commented Sep 9, 2012 at 10:27
  • so you are suggesting to create a folder action that runs the bash code above everytime a file is added to one of my regular folders? do folder actions apply to subfolders of the folder that the action was applied to?
    – sion
    Commented Sep 9, 2012 at 10:58
  • AFAIK folder actions are only triggered in the respective folders
    – nohillside
    Commented Sep 9, 2012 at 12:39
  • So would it affect the operation of cgdb if the .dSYM files are hidden or should it still function OK?
    – sion
    Commented Sep 10, 2012 at 1:22
  • cgdb isn't impacted, chflags only works on Finder level (Finder itself and any Open/Save dialogs)
    – nohillside
    Commented Sep 10, 2012 at 3:22

1 Answer 1


AFAIK there isn't a direct way to do this. There are several alternatives though:

  • Folder Actions: Create a folder action (which gets triggered upon each change in a folder) to run the chflags command if needed. As Folder Actions only apply to to one folder this needs an Action for every folder you create .dSYM files in
  • launchd: Use WatchPaths to run a script whenever one of the listed paths is modified
  • Hazel: Hazel is kind of like Folder Actions on steroids and allows you to create actions based on various rules

PS: cgdb isn't affected, chflags only makes files invisible on Finder level (and in Open/Save dialogs).

  • i like the idea of using launchd with watchpaths. Is this very resource consuming? Or does it actually do nothing until it is triggered? Also, is there a way to make the watchpaths command recursive?
    – sion
    Commented Sep 11, 2012 at 12:33
  • It does "nothing" til triggered. The watchpath statement isn't recursive but you can list as many directories as you want. And you can use find the create the directory list in the first place.
    – nohillside
    Commented Sep 11, 2012 at 12:57
  • I am a student and have to make new directories a couple of times every week for each new task. So i need a way of automating this for subdirectories. Is it possible to set a folder action on a directory that has the task of setting a folder action on each new directory placed in it?
    – sion
    Commented Sep 11, 2012 at 22:20

You must log in to answer this question.

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