Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Stormraven

macrumors newbie
Original poster
May 5, 2010
21
0
How can I hide certain files and folders on my iMac? Prefably without using a 3rd party application?

Please help me =[
 
How can I hide certain files and folders on my iMac? Prefably without using a 3rd party application?

Please help me =[

Open Terminal (in Utilities). Enter the following, but don't press return yet. Leave a space after the "n".

Code:
chflags hidden

Now select all the files you want to hide and drag and drop them into the Terminal window. (This will append the file paths to the chflags command.)
Then click on the Terminal window to make it active, and press return.

(You can use "nohidden" instead of "hidden" to make files visible again.)
 
It depends on how computer-savvy the person you're hiding them from is. LPZ's post will hide them pretty well, but if other people with access to your Mac know how to use the "ls -a" command in Terminal, they'll still be able to see the files.

Perhaps instead of hiding them you want to encrypt them? You can use Disk Utility (in /Applications/Utilities) to create an encrypted disk image (go to File->New->Blank Image). Then you can drag/drop files into it. Whenever you want to work with the files, you'll have to enter the password you've selected to mount the disk image, and you'll have to REMEMBER to unmount it when done. Name it something innocuous like "backups". Now, anyone will have to know the password to find out what's inside.
 
if other people with access to your Mac know how to use the "ls -a" command in Terminal, they'll still be able to see the files.

Actually, just "ls" will show them, unless their names also begin with a period character.

My suggestion simply "hides" the files from the GUI, eg. from Finder. I certainly didn't intend to suggest that this method of hiding is secure.
 
There are 3 methods that I know of.

1. in Terminal: sudo chflags hidden [drag file, folder or volume - use 'unhidden' for reverse]
2. if you have Xcode installed, you can use setfile application:
[drag setfile app] -a V [drag file, folder or volume to be hidden - use small case 'v' for reverse]
3. install supergetinfo. This one is easy, set the shortcut, use it on a folder or file and click on the 'invisible' box.

Sometimes I have to go through all 3 before one of them works, especially with volumes, so there are a few quirks and it pays off to have them all handy. Not really securely hidden, of course, but if one doesn't have a reason to search for hidden files, one will not search for hidden files. I use it mainly to hide volumes like time machine and other storage/backup discs away from my desktop.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.