22

I would like to reset the preferences for all my Mac OS X folders. Is this possible?

2 Answers 2

20

This would find and delete the files storing view options under your home directory:

find ~ -name .DS_Store -delete

(And don't forget the -name flag — without it it the command would delete everything in your home directory.)

As far as I (and Wikipedia) know, the .DS_Store files mostly store information about folder-specific view options.

6
  • 1
    Do these files only contain Finder view preferences, or maybe also some other data (e.g. thumbnail caches?)
    – Daniel Beck
    Commented Nov 23, 2011 at 20:32
  • 1
    @DanielBeck The Quick Look thumbnails are stored in /private/var/folders/*/*/*/com.apple.QuickLook.thumbnailcache.
    – Lri
    Commented Nov 23, 2011 at 20:55
  • 4
    Nice read about where they come from.
    – slhck
    Commented Nov 23, 2011 at 20:56
  • Read this if you want to get rid of .DS_Store files.
    – Arnie97
    Commented Jul 3, 2019 at 9:37
  • 1
    Correct but with some limitations: Finder caches the view preferences of "recently accessed" folders (I have no further details how many & how long, but it certainly does it). So even if you close all open Finder windows instances of "folder X", then delete that folder's .DS_Store via Terminal, then even relaunch Finder (in Dock alt-click Finder → Relaunch) then open "folder X", its old custom view preferences get restored. And if you ls -ldF .* before/after removal you notice that .DS_Store gets re-created with the exact same byte count.
    – porg
    Commented Jan 13, 2023 at 10:18
24

To restore a folder to the default view settings,

  1. Open the View Options panel (Command-J, or View » Show View Options);
  2. Then hold down the Option key and click the bottom button. With the Option key down, the ‘Use as Defaults’ button will change to ‘Restore to Defaults’.
2
  • Although the 'correct' answer is great (if you don't make mistakes in copying that dangerous command', this answer is excellent if you don't want to risk Terminal commands.
    – LWTBP
    Commented Nov 29, 2019 at 6:28
  • This IS the correct answer when doing this for a single folder for these reasons: + Fast and easy: ⌘J + click "Restore to Defaults") + The other approach (delete .DS_Store) does (sometimes) not work as Finder caches the view preferences in memory. See details in the comment thread there. + The other approach is beneficial for batch operations.
    – porg
    Commented Jan 13, 2023 at 10:05

You must log in to answer this question.

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