A cluttered Mac desktop covered in hundreds of stray screenshots, downloaded PDFs, and application shortcuts is visually overwhelming and can subtly impact your computer’s performance, as macOS renders a separate icon preview for every single file. If you are about to share your screen in a professional Zoom meeting or record a screencast, you might want a completely clean desktop without having to manually move all your files into a temporary folder. By executing a hidden terminal command, you can force macOS to automatically hide all your desktop icons instantly.
How to Hide Desktop Icons Using Terminal
Apple manages the display of desktop icons through the Finder’s internal preference files. We can modify these preferences using the defaults write command.
- Open the Terminal application on your Mac (you can find it in Applications > Utilities, or search for it using Spotlight by pressing Command + Space).
- Copy and paste the following command exactly as written, and press Enter:
defaults write com.apple.finder CreateDesktop false - The command will execute silently, modifying the preference file. However, the Finder is already running, so it does not know the rule has changed. You must force the Finder to restart and read the new rule.
- Type the following command and press Enter:
killall Finder
Your screen will briefly flash as the Finder restarts, and every single icon on your desktop will vanish, leaving you with a pristine wallpaper. The files are not deleted; they are simply hidden from the desktop view. You can still access them at any time by opening a new Finder window and clicking on the “Desktop” folder in the left-hand sidebar.
How to Restore the Desktop Icons
When your presentation is over and you want to see your files again, you simply need to reverse the boolean value in the preference file.
- Open the Terminal again.
- Type the following command (changing the word “false” to “true”) and press Enter:
defaults write com.apple.finder CreateDesktop true - Restart the Finder again to apply the change by typing:
killall Finder
Your desktop icons will instantly reappear exactly where you left them.