How to hide folders from desktop Mac

The Easiest Way to Hide Files and Folders on a Mac

  • Matt Klein

    @howtogeek


Doing stuff on a Mac is supposed to be so easy and intuitive, that its surprising when something isnt. There are several ways to hide stuff on a Mac, but only one of them really works well enough for us to recommend.

Its not even about hiding stuff so others cant see it. Sometimes you may simply want to hide something because you want to declutter your system. For example, if you move your Windows documents to the cloud, you will notice that many applications will often use your Documents folder for saving. Games too will often create their own folders in Documents.

The problem is that soon your Documents folder can become clutteredwith all these new folders. If youre using Windows, you can easily hide stuff using folderpreferences.

Windows folders: Now you see em now you dont.
Advertisement

With OS X, it isnt so easy [every operating system has a way to do it], and it might not be such an issue for a lot of users, but eventually there may come a time when you cantdelete a folder or file, but you also dont want to see it.

Command Line, Take Them Away!

To hide stuff on OS X, the best method is to use the Terminal, which can be accessed by either double-clickingit from Applications, or using Spotlight, which is ideally suited for launching apps that arent pinned to your Dock.

With our Terminal open, we use a single command and some dragging-and-dropping to hide whatever we want out of view.

Heres our Documents folder on OneDrive as seen in OS Xs Finder.

The Best Tech Newsletter Anywhere

Join 425,000 subscribers and get a daily digest of features, articles, news, and trivia.

Sign Me Up!
We've got your info - thanks for signing up!
We were unable to subscribe you! Please check your e-mail address or contact us for assistance.
Signing you up...

By submitting your email, you agree to the Terms of Use and Privacy Policy.

Advertisement

You rememberthatearlier Windows screenshot? All we needed to do to clean up this folder was to hide everything we didnt want to see with a simple right-click.

OS X doesnt have that capability, and we cant move these things because it might mess stuff up on our Windows machines because its synced to the cloud.

Returning to our Terminal window, we type the command chflags hidden just like it is in the quotes. Make sure you add the space to the end; its important for what were about to do. Go the to the location where you want to hide stuff, hold down the Command key and click to select all the files and folders you want to hide. Once youre finished, simply drag them into the Terminal window.

The command prompt will paste all the locations you just dragged behind the chflags command. Heres an example of what that might look like. All you do now is hit Return and everything will disappear.

Advertisement

This saves you a ton of time and typing because you dont have to enterin each location and file by hand, and you also can hide a bunch of stuff at once.

The end result is a much nicer and cleaner Documents folder, similar to what we createdin Windows File Explorer.

Undoing What You Just Did

Undoing all this isnt quite as easy, because when you open your folder, the stuff you have hidden wont show. Again,in File Explorer, its a great deal easier to show hidden items.

Nevertheless, open your OS X Terminal again, but this time navigate to the root folder where all your hidden stuff resides. In our example, its in our Documents folder, which is on our OneDrive.

Advertisement

We use the change directory [cd] command where, after cd youd insert the path where you want to go. Again, you dont have to type the path, you can simply drag the location over to Terminal. Just remember to add the space after cd.

Once youve changed directories, type the ls command to list everything in the directory, and then use the chflags nohidden command. Stuff with spaces between words is denoted with a \ such as Microsoft\ Hardware or Custom\ Office\ Templates.

If youve ever used the Terminal, then you might know you dont have to retype commands over and over. You can actually recycle command by using the up and down arrow keys. This is really convenient if you have a command or commands you need to execute over and over, but dont want to type and type and type.

RELATED: How to Hide Files and Folders on Every Operating System

So, there you have it, hiding and unhiding folders and files in OS X. While its not exactly the most elegant method, it gets the job done.

Advertisement

Have another method or tips you would like share with us? Please, talk to us in our discussion forum.

Matt Klein
Matt Klein has nearly two decades of technical writing experience. He's covered Windows, Android, macOS, Microsoft Office, and everything in between. He's even written a book, The How-To Geek Guide to Windows 8. Read Full Bio »

Video liên quan

Chủ Đề