Hiding Files and Folders from Finder with OS X

I’m mostly posting this for my own reference (because I always forget). May google share this tidbit with those who seek it.

OS X’s HFS+ file system has some special attributes that can be set from the command line, the most useful of which might well be the “Invisible” flag.

sudo /Developer/Tools/SetFile -a V /opt

Note the capital “V”. A lowercase “v” will make the file or directory visible.

sudo /Developer/Tools/SetFile -a v /opt

To play, you need to have Xcode and friends installed. See the man page for the SetFile command for more information.

1 Response to “Hiding Files and Folders from Finder with OS X”


  1. Gravatar Icon 1 Adam

    That’s pretty rad. Now I know why /usr and /etc and the like are invisible from Finder, and now how to undo that mess.

    Do you know of a command to read what the visibility of a file is?

Leave a Reply