Hide any File or Folder by making it Invisible to the Mac OS X Finder

This is a really cool trick that should be particularly useful to those who share their mac with other people. I use this trick all the time to hide my personal files before my roommate uses my computer, and it’s easy to do if you know how but it’s unlikely that another user will even think to look in a directory via the Terminal to find the file.

Make a file or folder invisible in Mac OS X Finder

setfile -a V testfile.txt

Poof! Like magic, the file or folder is no longer visible via the Finder GUI, but don’t worry your files are still there and you can find them via the command line and will show with an ls command. If you want to make your files and folders visible again, use this command:

Make a file or folder visible again in Mac OS X Finder

setfile -a v testfile.txt

Now the file/folder will be visible again to the Finder, cool huh?

Note: setfile is a command line utility included in Apple’s Developer Tools, which is a highly recommended optional install included on any Mac OS X install/restore CD/DVD and also available as a rather large download from Apple’s Developer center. If you want to use setfile without installing Developer Tools you can try this trick on macosxhints.com. Thanks for pointing this out Albert!

Related Posts with Thumbnails

12 Comments

» Comments RSS Feed

  1. Albert says:

    ’setfile’ is not a Leopard command, is it?

  2. ’setfile’ is an utility from Apple’s developer’s kit and is not included in default Leopard install.

  3. Chris B says:

    Wonders if this command can be put into an AppleScript, thus more easily called when one wants to hide/show a certain folder. (And name it something that doesn’t reveal it’s true operation).

    An even better way to hide folders from roommates is to set up a ‘Guest’ account so others can use your computer without prying into your files. Simply logging out of your account or set up a screen saver password seems easier than pulling up the terminal, etc.

  4. Benoit Garbinato says:

    It’s SetFile, not setfile…

  5. Benoit Garbinato says:

    It’s SetFile, not setfile…

  6. Benoit Garbinato says:

    It’s SetFile, not setfile…

  7. Benoit Garbinato says:

    It’s SetFile, not setfile…

  8. Bobby says:

    If I don’t want to share certain files, I use Disk Utility to create an encrypted disk image, then, because no-one likes stuff being kept from them (”I thought you trusted me etc etc?”), I copy-paste a folder icon onto the dmg and give it a system-file-esque sort of name with the extension hidden.

    It ends up effectively being a password-protected (yet totally average looking) folder, and there’s not much chance of accidentally leaving it available to others (it clearly mounts on the desktop with the drive icon and only needs ejecting when you’re done with it)

  9. Nevil says:

    I have installed Snow Leopard and have tried typing this SetFile command. It is not an actual command as far as I can tell.

  10. James S. says:

    Nice little trick! If one uses this on a folder, one can still access it in Finder using the “goto” command (Shift-Cmd-G) and typing the path.

Leave a Reply

 

Save big on Apple & Mac Deals from Amazon.com

Recent Comments

Shared on Facebook

Support Us

Mac Picks

iPhone & iPad Picks

Mac from PC Picks