I use SetFile via the terminal to render files and folders invisible inside Finder windows. This does not appear to work on symbolic links: the symlink destination is made invisible, rather than the symlink itself.

I see a number of symlinks in / which are invisible in the Finder (e.g. /etc -> private/etc), so it seems to be possible. Can I duplicate this behavior?


To hide:

chflags -h hidden <symlink>

To show again:

chflags -h nohidden <symlink>
  • Note that the -h option was only added in Lion. I prefer using chflags, since SetFile only comes with Developer Tools. – Eric3 Apr 25 '13 at 15:31
  • -h If the file is a symbolic link, change the mode of the link itself rather than the file to which it points. – malhal Aug 19 '17 at 22:57

Reading fail.

-P                                # perform action on symlink instead of following it

This flag has strange indenting in SetFile -h, and I must have just ignored it assuming it was related to the -m date flag.


SetFile -P -a V my_symlink
  • I got your flag, but it is okay to answer your own question if you find the answer yourself. Just be sure to check the other answers to make sure there isn't one better than your own. No worries. – Philip Regan Sep 6 '11 at 15:43

If you use ln -s source_file target_file from a terminal you'll get e.g. /etc -> private/etc shown in the ls -la - but only shown the target_file in the folder.

You must log in to answer this question.

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