Where is the list of hidden folders kept?
October 24, 2007 2:24 PM Subscribe
Mac OS X filter: In terminal, if I go to / and ls, I see a bunch of folders that are hidden in Finder, for example /etc, /private, /sbin, and so on. How do I add a folder to that list?
In the dark recesses of my memory I remember there being some kind of file somewhere that contains a list of the paths that the Finder should hide, but my Google-fu is failing me and I can only find people telling me how to turn ON the "show hidden files and folders" option, which isn't what I want at all!
If you care, it's because I have a /sw folder that Fink created, that I want to be hidden too. Any pointers greatly appreciated.
In the dark recesses of my memory I remember there being some kind of file somewhere that contains a list of the paths that the Finder should hide, but my Google-fu is failing me and I can only find people telling me how to turn ON the "show hidden files and folders" option, which isn't what I want at all!
If you care, it's because I have a /sw folder that Fink created, that I want to be hidden too. Any pointers greatly appreciated.
create a folder from the command line with a period at the start and finder won't 'see' it:
> mkdir .pr0n for example
posted by ReiToei at 2:43 PM on October 24, 2007
> mkdir .pr0n for example
posted by ReiToei at 2:43 PM on October 24, 2007
my bad... if you're doing it from root, you'd have to use
> sudo mkdir .pr0n
and enter your password
posted by ReiToei at 2:45 PM on October 24, 2007
> sudo mkdir .pr0n
and enter your password
posted by ReiToei at 2:45 PM on October 24, 2007
The old way was with a file named '.hidden'. The new way is with attributes on the specific files.
To set the hidden flag on sw, you'd do "chflags hidden /sw".
(I think SetFile will probably boil down to the same thing, but chflags comes with the system and doesn't require that you install the dev tools.)
posted by xil at 2:49 PM on October 24, 2007
To set the hidden flag on sw, you'd do "chflags hidden /sw".
(I think SetFile will probably boil down to the same thing, but chflags comes with the system and doesn't require that you install the dev tools.)
posted by xil at 2:49 PM on October 24, 2007
xil: is that a Leopard thing? On 10.4 I get "chflags: invalid flag: hidden".
posted by sbutler at 2:52 PM on October 24, 2007
posted by sbutler at 2:52 PM on October 24, 2007
Response by poster: The SetFile thing worked perfectly (although it only works in you have Xcode installed it seems). I had to stick a sudo in front of it as the folder was owned by root... thanks sbutler!
I knew about the . to make hidden files and folders... unfortunately I wanted to hide a folder that already existed that I didn't have control over or couldn't change later.
Also thanks to xil for preventing my continued mental anguish about the file I remembered editing ages ago ;) chflags doesn't seem to work though.
posted by jon4009 at 2:54 PM on October 24, 2007
I knew about the . to make hidden files and folders... unfortunately I wanted to hide a folder that already existed that I didn't have control over or couldn't change later.
Also thanks to xil for preventing my continued mental anguish about the file I remembered editing ages ago ;) chflags doesn't seem to work though.
posted by jon4009 at 2:54 PM on October 24, 2007
The SetFile thing worked perfectly (although it only works in you have Xcode installed it seems).
SetFile is only installed with the dev tools; it's not part of the standard OS install.
posted by secret about box at 5:02 PM on October 24, 2007
SetFile is only installed with the dev tools; it's not part of the standard OS install.
posted by secret about box at 5:02 PM on October 24, 2007
You can also make a hidden file from the finder when you have hidden files set to be shown.
posted by ooklala at 6:07 PM on October 24, 2007
posted by ooklala at 6:07 PM on October 24, 2007
This thread is closed to new comments.
/Developer/Tools/SetFile -a V /sw
It should grey the icon immediately, but you'll need to logout/login to see the real change.
posted by sbutler at 2:43 PM on October 24, 2007