View Full Version : How do I hide files?
SecurityTinker
May 19, 2008, 07:36 PM
I have a flash drive that I use on both Macs and PCs. There are files that need to be in the root directory of the drive. (autorun.inf) I do not want to see this file, so in Windows, I just right click on it and check "Hidden". But when I plug the drive into a Mac, I see all these files. I want them to be hidden in both Explorer in windows and Finder on a Mac. Is there any way to do this without renaming the files?
I want to hide them for the sake of hiding them.
It's not sensitive material
It still needs to be readable by Windows
I want to hide them to make the root of the drive look nicer. Example: When people are browsing your Mac, you don't want them to see the var and etc directories on the system drive. It doesn't look nice!
The General
May 20, 2008, 12:50 AM
Make it hidden in Windows and name the Folder with a . at the front of it.
SecurityTinker
May 22, 2008, 03:02 AM
You didn't read the post..
GotPro
May 22, 2008, 06:10 AM
There are a couple of ways to do this.
The first is to enable the invisibility bit on each individual file by use of a command line tool (part of the developer's tools that came on your OS X installation discs-- you may have to install them) called SetFile.
The command is something like this:
SetFile -a V filename
After doing this, you will need to quit and relaunch the finder for the changes to take effect.
The second way is to create a file using vi in terminal called /.hidden
This was used in OS X 10.3 to maintain a list of files to always hide. While obsolete in 10.4 and above, the Finder (at least in 10.4... haven't tried it yet in leopard) will still respect the list if it is in fact there.
Make sure you use vi or something similar to create / edit the file to ensure you don't have anything uninterpretable accidentally being inserted in the file...
In the /.hidden file, you'll want to list the COMPLETE PATH to every single file that you want to hide.
Again, you'll need to quit and re-launch the Finder before the changes take effect.
SecurityTinker
May 22, 2008, 11:06 PM
Thanks guys, but on another forum they've suggested JuhOS X, and it's worked surprisingly well. (At least for the small task I wanted to perform)
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.