• Home
  • How To
  • Mac
  • OS X
  • How to Quickly Hide a File or Folder on Your Mac (With a Single Terminal Command!)

How to Quickly Hide a File or Folder on Your Mac (With a Single Terminal Command!)

How to Quickly Hide a File or Folder on Your Mac (With a Single Terminal Command!)

Imagine this: You’re a consultant, and you have a client coming over to your office to review some recent work you’ve done. You need to show them using your Mac – but you have some sensitive stuff on your desktop you don’t want them to see – even the file names could be revealing! The client will be there in 3 minutes…what do you do?

Screen Shot 2013-07-24 at 9.11.56 PM

The same situation could arise in any of a dozen similar situations. Luckily, there’s a way out of this nightmare – and all it requires is a single, simple terminal command! To hide the file or folder, simply launch Terminal, and enter the following command (replacing “/path/to/content-you-want-to-hide” with the actual path of whatever you want to hide, of course):

chflags hidden /path/to/content-you-want-to-hide

Now, just press enter to send the command, and you’re done! You can repeat it as many times as you need in case you have several things that need to be hidden.

When you no longer want the items to be hidden, reversing the action is a matter of a simple counter-command:

chflags nohidden /path/to/content-you-want-to-hide

It’s worth noting that this command isn’t a good idea for the long term, especially if the person you’re hiding something from has at least occasional access to your computer – but it’s great to quickly get something out of sight with little to no notice!

For more helpful tips for your Apple devices, check out our full collection of tutorials by visiting our How-To category!