1. Computing

Discuss in my forum

Use Terminal To Clean Up Your Desktop

Hide Desktop Icons With Terminal

By

Clean Up Your Desktop: Use Terminal To Clean Up Your Desktop

Desktop before.

If your Mac desktop is anything like mine, it tends to get cluttered up with files and folders faster than you can organize and file them. In other words, much like a real desktop.

And just like a real desk, there are times when you wish you could just sweep all the debris off the Mac desktop and into a drawer. Believe it or not, you can do this (well, except for the drawer part). Best of all, when you clean up your Mac desktop, you don’t have to worry about losing any of the information. It all stays right where it is; it just becomes hidden from view.

A clean desktop is perfect for taking screen shots, when you don’t want your desktop clutter to show, or just for clearing out the view when you need to concentrate. Here is how I make my desktop so neat for all of the screen shots I post here on About: Macs.

Use Terminal to Clean Up Your Desktop

  1. Launch Terminal, located at /Applications/Utilities/Terminal.
  2. Enter the following command line into Terminal. You can copy/paste the text into Terminal, or you can simply type the text as shown. The command is a single line of text, but your browser may break it into multiple lines. Be sure to enter the command as a single line in the Terminal application.
  3. defaults write com.apple.finder CreateDesktop -bool false

  4. Press enter or return.
  5. Enter the following text into Terminal. If you type the text rather than copy/paste it, be sure to match the case of the text.
  6. killall Finder

  7. Press enter or return.
  8. The Finder will disappear for a moment, and then reappear.
  9. Enter the following text into Terminal.
  10. exit

  11. Press enter or return.
  12. The exit command will cause Terminal to end the current session. You can then quit the Terminal application.

Your desktop will now be clear of all of its previous clutter of icons, including icons for files, folders, hard drives, and removable media. Only your desktop’s background image, the Dock, the menu bar, and open windows will be visible.

You can still use your Mac and the Finder just like you normally do. You can even save or open files, create or move folders, or manipulate anything that was on the desktop, although you will have to do that from a Finder window open to your Desktop.

If you find you miss your messy desktop, it’s easy to get everything back by following these simple steps.

Use Terminal to Restore Your Messy Desktop

  1. Launch Terminal, located at /Applications/Utilities/Terminal.
  2. Enter the following command line into Terminal. You can copy/paste the text into Terminal, or you can simply type the text as shown. The command is a single line of text, but your browser may break it into multiple lines. Be sure to enter the command as a single line in the Terminal application.
  3. defaults write com.apple.finder CreateDesktop -bool true

  4. Press enter or return.
  5. Enter the following text into Terminal. If you type the text rather than copy/paste it, be sure to match the case of the text.
  6. killall Finder

  7. Press enter or return.
  8. The Finder will disappear for a moment, and then reappear.
  9. Enter the following text into Terminal.
  10. exit

  11. Press enter or return.
  12. The exit command will cause Terminal to end the current session. You can then quit the Terminal application.

That’s it. Your old desktop, messy icons and all, will be back, looking just as it did before you made it disappear. But whenever you need to clean house again, you’ll know the Terminal equivalent of sweeping everything under the rug.

  1. About.com
  2. Computing
  3. Macs
  4. Using Your Mac
  5. Clean Up Your Desktop: Use Terminal To Clean Up Your Desktop

©2014 About.com. All rights reserved.