Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

To hide:

chflags -h hidden <symlink>

To show again:

chflags -h nohidden <symlink>
share|improve this answer
    
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

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.

So,

SetFile -P -a V my_symlink
share|improve this answer
    
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.