Unhiding Unix Directories
I would like to "unhide" some of the standard unix directories so that they're visible in the Finder. Is this simply a matter of editing the .hidden file?
MacBook, Mac OS X (10.6.8), Matching white Peterbilt 386
I would like to "unhide" some of the standard unix directories so that they're visible in the Finder. Is this simply a matter of editing the .hidden file?
MacBook, Mac OS X (10.6.8), Matching white Peterbilt 386
Oh brother, I see what I did now. Your post, rccharles, even though it was the opposite of what I was trying to do, made me go back and look at the .hidden file. My mistake was in unthinkingly editing out bin instead of usr. That is what prevented the directory being visible. But since I hadn't changed the flag on bin - which I had no intention of making visible in the first place - it did not appear in Finder, so I did not notice my mistake.
The correct answer would be:
To make a standard unix file or directory visible, remove its entry from the .hidden file, then change the visibility flag either with chflag:
sudo chflags nohidden /foo
Or with SetFile:
sudo SetFile -a v /foo
Assuming, of course, that you've added /Developer/Tools to your path.
Thanks everyone for all of your help! (though I feel a litlle foolish at the moment)
The correct answer would be:
To make a standard unix file or directory visible, remove its entry from the .hidden file, then change the visibility flag either with chflag:
The correct answer is remove .hidden. I am not sure what version of the OS you are using but Snow Leopard (maybe Leopard too, never used that) doesn't even have .hidden. Tiger did. This is why I had to create that script in the first place. With Tiger all I had to do was edit .hidden.
I just did an experiment on my Lion (Mac OS X 10.7.4) system.
I navigated Finder to the root directory (Finder -> Go -> Go to folder -> /
/usr showed up as soon as I executed:
sudo chflags nohidden /usrand /usr disappeared as soon as I executed:
sudo chflags hidden /usrThe same thing happened on my Snow Leopard (Mac OS X 10.6.8) Mac mini, although when I use Finder -> Go -> Go to folder -> /, it seemed to take me to /Volumes, and not /, so I had to double click on my boot drive as listed in /Volumes before I got to root. I'm guessing this has to do with the fact that my Mac mini has a bunch of external storage drives and my Macbook Pro does not. Not what I would expect, but perhaps the Finder authors are being inventive 🙂
Either your Mac OS X version does not play the same as mine, or something else is amiss on your system.
The .hidden file was removed in Leopard in favor of setting the visable-invisible attribute in the Finder Info. As of 10.6 the .hidden file can hide directories and takes precedence over the Finder attribute. Here's another solution to make a hidden directory /usr visable
xattr -d com.apple.FinderInfo /usrSo neither Leopard nor Lion installs a .hidden file? That's interesting. Perhaps the .hidden file was transferred, or rather, kept, when I upgraded?
Unhiding Unix Directories