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.






