Set Finder Preferences – Command Line

SettingĀ  the following Finder Preferences enables the specified drives to be shown on the Desktop, the same as going to Finder, Preferences, General and ticking the boxes

defaults write ShowExternalHardDrivesOnDesktop -bool true
defaults write ShowHardDrivesOnDesktop -bool true
defaults write ShowMountedServersOnDesktop -bool true
defaults write ShowRemovableMediaOnDesktop -bool true

To set it so that a New Finder Window shows your home folder, enter the following into Terminal

defaults write NewWindowTarget PfHm