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
You need to change the AppleShowAllFiles setting.
(67530)
sudo chflags nohidden /usr
sudo wants your password, you must be an admin, and it will not echo your the password, just take it on faith it is being entered, then hit return.
See "man chflags"
You need to change the AppleShowAllFiles setting.
Is that a global preference setting? I only want to unhide certain directories, such as /usr
Where would you write that to anyway?
sudo chflags nohidden /usr
The "hidden" flag is off for /usr, yet the dir still doesn't show in the Finder.
ls -lO /
lrwxr-xr-x@ 1 root wheel hidden 11 Oct 24 2009 tmp -> private/tmp
drwxr-xr-x 14 root wheel - 476 Sep 25 2010 usr
I also deleted usr from the .hidden file. Still no luck. Which brings up the question of the purpose of the .hidden file.
I tried restarting the Finder. Perhaps I should try a system restart? But really, that shouldn't be necessary. Nevertheless....
It's issued with the following Terminal command:
defaults write com.apple.finder AppleShowAllFiles 1
and then restarting the Finder.
(67531)
It's issued with the following Terminal command:
defaults write com.apple.finder AppleShowAllFiles 1
and then restarting the Finder.
Thanks! That is good to know. But of course, that is a global pref, and I do like that the Finder isn't all cluttered with files and directories I rarely need see. Any ideas on unhiding specific directories? I find myself wanting to access certain sub-directories of /usr via the Finder quite often, and it would save me a lot of typing if I could simply click on it and drill down.
Instead of unhiding them, use the Go to Folder command in the Finder's Go menu. This function ignores invisibility but considers permissions.
(67532)
Instead of unhiding them, use the Go to Folder command in the Finder's Go menu. This function ignores invisibility but considers permissions.
Naturally, that's what I've been doing. Or, if I have the Terminal open, I can type: open /usr/share/whatever. But, twenty-six years of Mac OS use has given me a feeling of entitlement, that I should be able to have things as I like them. (Come to think of it, it's possible I've always had this attitude.)
Is there some technical reason why I can't have this, or any other particular directory or file, visible? That is, a technical reason that cannot be overcome?
sudont wrote:
Is there some technical reason why I can't have this, or any other particular directory or file, visible? That is, a technical reason that cannot be overcome?
Anything can be overcome with enough effort (on computers, anyway). You can probably accomplish what you want using the Developer Tools SetFile unix command. However, there are times when it's best to bend with the wind. Those files are hidden with the anticipation that people who don't know what they are doing will have a hard time finding them and will be less likely to nuke their computers by accident. It's a minor hardship for people who do know what they're doing, of course, but I'd recommend adapting to the way things are unless you have a decidedly good reason not to.
You can probably accomplish what you want using the Developer Tools SetFile unix command.
The dir is already set to "visible".
GetFileInfo /usr
directory: "/usr"
attributes: avbstclinmedz
created: 05/19/2009 01:10:12
modified: 09/25/2010 12:27:09
Yet, it still does not show in the Finder. So I don't believe SetFile would be of further help - unless it is another flag that needs changing, but I don't see it.
sudont wrote:
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?
Whenever I set up a new machine one of the first things I do is run the following script:
#!/bin/sh
# This script uses Setfile to remove the Finder "invisible" flag.
# A chflags nohidden is a possible substitute.
# fixup_hidden_snowleopard [volume]
# Optional argument used to specify a boot volume.
for f in bin sbin private usr System; do
echo $f
sudo /Developer/Tools/SetFile -a v "$1"/$f
#sudo chflags nohidden "$1"/$f
done
I use SetFile in xcode but I show a commented out chflags command which should equally work.
I prefer being able to always get at those directories (bin, sbin, private, usr, System) if I need to (I won't go into why).
You could create a symlink from your home directory (or an alias) that is not hidden.
I do this for accessing the apache system wide web index.html file's directory.
I use SetFile in xcode but I show a commented out chflags command which should equally work.
I have chflag'ed it, and we can see that it no longer has the hidden, or invisible, flag, (capital 'v'), as do all the other unix directories. As you can see, anything your script would do has already been done.
ls -lO /
drwxr-xr-x 14 root wheel - 476 Sep 25 2010 usr
GetFileInfo /usr
directory: "/usr"
attributes: avbstclinmedz
created: 05/19/2009 01:10:12
modified: 09/25/2010 12:27:09
Yet, I seem to be missing something, because the folder still does not show in Finder. I'm really curious to know why it is still invisible.
I prefer being able to always get at those directories (bin, sbin, private, usr, System) if I need to (I won't go into why).
Sometimes it's easier to click on a folder than to type a path. If you need to access a file, you should be able to get to it any way you see fit.
Macintosh-HD -> Applications -> Utilities -> Terminal
# Show hidden files & folders in finder
# Just copy the the line starting with defaults into the terminal
defaults write com.apple.finder AppleShowAllFiles TRUE ;killall Finder
# Normal display. Hide hidden files & folders in finder
# Just copy the the line starting with defaults into the terminal
defaults write com.apple.finder AppleShowAllFiles FALSE ;killall Finder
The finder comes right back.
.. Don't knw how valid this is anymore. ..
Macintosh-HD -> Applications -> Utilities -> Terminal
In terminal, type "sudo pico /.hidden", hit return, and type in your password. It doesn't display. Press enter when done typing. When the editor comes up, it should contain the following text. This is a list of all the files and folders at the root of the hard drive that should be hidden from view. (you may not have all those files your hard drive, this is a full list of all the things it should hide if present) If it does not, enter in the missing lines. (order is not important, you can add missing entries to the end if you like) Control-O and Return to save, Control-X to quit. You may have to either log out or restart to make this change effective.
automount
bin
cores
Desktop DB
Desktop DF
Desktop Folder
dev
etc
lost+found
mach
mach_kernel
mach.sym
private
sbin
tmp
Trash
usr
var
VM Storage
You could create a symlink from your home directory (or an alias) that is not hidden.
Yes, I thought of that. But now I'm at the point where I want to know what exactly is preventing me from accomplishing this seemingly simple task.
Unhiding Unix Directories