X

Clear folder view problems by removing DS_Store files

<p>For every window in Mac OS X, a hidden file called ".DS_Store" contains the information on how the window is to be displayed (such as, which columns are shown for "list" mode, icon sizes, window position, and so on). When you change settings in the vie

CNET staff
3 min read

For every window in Mac OS X, a hidden file called ".DS_Store" contains the information on how the window is to be displayed (such as, which columns are shown for "list" mode, icon sizes, window position, and so on). When you change settings in the view options for a window (Command-J), the DS_Store file is updated to reflect these settings. Sometimes, if a DS_Store file is corrupted, window settings may not stick, and can either revert or just not function at all.

Apple discussion user "ibjoshua" writes:

"My default setting for the Finder is to have folders display in list view with the size column turned off. This works like a charm for every folder except the Applications folder which always displays a size column whenever the finder is re-launched (it's always scrolled to the bottom of the list too, which is weird). It wouldn't bother me if the size values were cached somehow and just updated quietly in the background but it takes quite a while to calculate each value and actually slows down the finder."

To reset the settings for a given folder, first open the Terminal application and type "rm" followed by a space. Then locate the folder that gives you the problematic view settings (don't open it yet), and drag it to the Terminal window (this will enter the full path to the folder). When the full path is entered in this way, the Terminal will put a space after the folder name. Delete this space and type "/.DS_Store", so the command looks something like the following:

rm /path/to/folder/.DS_Store

Then press enter to execute the command and remove the DS_Store file. After this is done, open the folder and use the view options (Command-J) to customize the folder view again.

In addition to problems with individual window views, you may wish to just reset all window customizations and clear any potential problems you're having with window views. While you can go through and remove all the DS_Store files for each problematic folder, the simplest way may be to just remove all of them using a program such as "Blue Harvest". However, if you wish to use the terminal for removing all DS_Store files, the following command can be used (in Applescripts, Automator scripts, or Shell scripts) to do the same thing:

sudo find / -name ".DS_Store" -depth -exec rm {} \

An additional benefit of using Blue Harvest is that you can customize DS_Store creation behavior, such as preventing the Finder from creating DS_Store files on network servers, external drives, specific drive formats, or other customized locations. As such, if you're experiencing problems with these files appearing for Windows users who access the same volumes or locations, this functionality can be used to prevent clutter.

In some instances, these problems may not only be with DS_Store files being corrupted, but also if they're just inaccessible by your account. If you do not have write access to the folder, then you will not be able to edit the DS_Store file and any settings you may change will be reverted. As such, if you are using a nonadministrator account and are experiencing these problems for folders such as system folders or the Applications folder, then try either removing the DS_Store document or editing folder views when logged in as Admin, or giving your account write permissions to the folder in question. To do this, right-click the folder in the Finder and click the lock to authenticate. Then in the "Permissions" section click the plus sign and add your account to the list, giving the account write permissions.

Have an alternative approach to fixing problems? We'd love to hear it. Post comments below if it relates to this topic, or send us feedback at: http://www.macfixit.com/contact

Resources

  • ibjoshua
  • Blue Harvest
  • http://www.macfixit.com/co...
  • More from Late-Breakers