How to Clean Up and Hide Desktop Icons in OS X

Posted by Jim Tanous on August 23, 2014
Messy Desktop

Many Mac users view their desktop as a catch-all repository for their files, documents, and projects. The desktop is also where OS X displays connected hard drives, network folders, and disk images, making it a potentially disorganized mess in many instances.

Messy Desktop OS X

We’ve all seen desktops even messier than this.

We won’t get into the merits of proper file and folder organization, but even users for whom a messy desktop is acceptable may occasionally want to clear their desktop of all this clutter so that they can focus clearly on a new task or present a tidy backdrop for screencasts. You can always clear your desktop by manually moving files and folders to another location on your Mac’s hard drive, but a quicker and easier way is to temporarily hide desktop items with a quick Terminal command. Here’s how to hide desktop icons in OS X.
First, launch Terminal (located in the Applications > Utilities folder). Then copy and paste the following command and press Return to execute it:

defaults write com.apple.finder CreateDesktop false; killall Finder

This preference disables OS X’s ability to draw desktop icons, and you’ll notice that all of your files, folders, and drives have suddenly disappeared. But don’t worry! They’re not deleted, just hidden.

Hide Desktop Icons OS X

All desktop icons, including drives and network locations, are hidden.

To demonstrate this, open a Finder window and navigate to your user’s desktop folder. You’ll see that all of your files are still fine and dandy. OS X is simply declining to show them on the desktop. In fact, while this command is enabled, you can continue to store, retrieve, and use files on your desktop without issue. You’ll simply need to do so via a Finder window instead of the desktop itself.
Desktop Icons in Finder OS X

You can still see and access your desktop files via Finder.

When you’re ready to restore your desktop icons, head back to Terminal and use this command instead:

defaults write com.apple.finder CreateDesktop true; killall Finder

This allows OS X to draw desktop icons once again, and you’ll see all your icons reappear as quickly as they disappeared. This Terminal command to hide desktop icons survives a reboot, but not an OS X upgrade, so you’ll need to reenable the command if you update to a new version of OS X.
If you frequently need to hide desktop icons for things like screenshots and screencasts, you may want to consider third party software such as Desktop Curtain, which offers more advanced functionality such as the ability to use a custom backdrop or hide all but a single application. But if you just need a clean desktop in a pinch, the Terminal command discussed here should do the trick.

2 thoughts on “How to Clean Up and Hide Desktop Icons in OS X”

Adam "Fuzzy" Konner says:
I created a simple “Show/Hide Desktop” Automator app based on this article that toggles the state of the desktop icons. Here’s the code:

if [ `defaults read com.apple.finder CreateDesktop` = true ]; then
defaults write com.apple.finder CreateDesktop false && killall Finder
defaults write com.apple.finder CreateDesktop true && killall Finder

1. Open Automator
2. New > Application
3. Utilities > Run Shell Script
4. Paste the code snippet
5. Save and put in your Dock or wherever!
Of course you could also use it as a Service or a command line script. Hope this helps someone out there.
Ismail says:
Hi Adam!
Thanks for the Automator app. Very handy 🙂
Imani says:
This is so awesome and easy! thank yoou.

Leave a Reply

Your email address will not be published. Required fields are marked *

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.