I would like to reset the preferences for all my Mac OS X folders. Is this possible?
2 Answers
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.
-
1Do 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
.– LriCommented Nov 23, 2011 at 20:55 -
4
-
-
1Correct 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.– porgCommented Jan 13, 2023 at 10:18
To restore a folder to the default view settings,
- Open the View Options panel (Command-J, or View » Show View Options);
- 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’.
-
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.– LWTBPCommented 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.– porgCommented Jan 13, 2023 at 10:05