I run the following command:

sudo defaults write ~/Library/Preferences/com.apple.finder.plist ShowHardDrivesOnDesktop -boolean TRUE

in hopes that this will cause system hard drives to show on the desktop, which doesn't happen. I kill all Finder processes and restart Finder, but no dice.

I try to open com.apple.finder.plist in Xcode, but it says I do not have permissions to view the file (I was able to before). Shortly after, I am able to open it, but the file is empty. The attributes are slowly regenerating.

What is happening here? I am looking for a command to toggle the option to show hard drives on the desktop, just as if I checked the box in Finder preferences.


First of all you shouldn't need sudo and it may have caused the permissions issue, and no need to use the full pathname, just:

defaults write com.apple.finder ShowHardDrivesOnDesktop -boolean TRUE

The following works for me, as is, in OS X 10.8.5 and macOS 10.12.5 in both a Standard and Admin Account in Terminal.

defaults write com.apple.finder ShowHardDrivesOnDesktop -boolean TRUE; killall Finder

Using FALSE, in place of TRUE hides the e.g. Macintosh HD on the Desktop.

I'd probably opt to either restore the file from a known good backup or delete the ~/Library/Preferences/com.apple.finder.plist file and then run killall Finder in Terminal, letting it rebuild and should resolve the permissions issue as well.

  • That worked for me. I think my problem had to do with me using 'sudo' and running 'killall Finder' in a separate line, after the running Finder process already messed things up.
    – squarjn
    Jul 11 '17 at 17:04
  • @squarjn, Running killall Finder on a separate line should not be an issue, I just do it all on one line for efficiency. The real issue was you using sudo, as you shouldn't have in this use case. Jul 11 '17 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .