Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Guys, I'm on a mac and want to access the Safari Preferences File using a bash script. I want to know the default folder set by a user for saving downloaded files. I know that the preferences are in the '/Users/username/Library/Safari' folder on mac.

Which file stores the "Save Downloaded files to:" value?

share|improve this question
up vote 1 down vote accepted

The following commands will access the preference API and write the preference you want.

defaults write DownloadsPath = \"~/Downloads\"
defaults write NSNavLastRootDirectory = \"~/Downloads\"

DownloadsPath is the default download directory. NSNavLastRootDirectory is the folder last accessed in the Save dialog.

The file is ~/Library/Preferences/, by the by. But using the defaults utility is preferable to manually modifying the file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.