wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 18 people, some anonymous, worked to edit and improve it over time.
This article has been viewed 254,447 times.
Learn more...
The Finder automatically places a .DS_Store file into every folder you have opened. .DS_Store files are created by the Finder during its normal course of operation. These files hold view options, including the positions of icons, size of the Finder window, window backgrounds plus many more properties but are hidden from the user's view.
.DS_Store files can become corrupted and cause Finder to behave oddly when you open the folder that contains it. Corrupted .DS_Store files cause problems like a Finder window blinking open and then closing, the inability to see some icons, or sort icons, or to change the view options.
Steps
-
1To delete a corrupted .DS_Store file you will need to use Terminal.app. To do that you must be logged into Mac OS X as an administrator.
-
2Open Terminal.
- Open a new finder window and navigate to the Applications folder on the left. (Alternately, when it says 'Finder' beside your Apple in the top left hand corner of the screen, select the 'Go' menu and click 'Applications'.)
- Inside the Applications folder near the very bottom is the 'Utilities' folder. Open that folder.
- Find and double-click the 'Terminal' application with the left mouse button to open it.
Advertisement -
3Give yourself super-user (root) permissions in Terminal so you can use the commands needed to delete some .DS_Store files. This is done using the 'sudo' command (Switch User and Do).
- In terminal type the following sudo ls (all lowercase) and hit [Return] on your keyboard.
- Terminal will prompt you for a password Use your administrator account password. If you don't have a password, leave it blank. [NOTE: For security reasons, unlike Windows, Mac OS X won't show any sign that you are typing your password, just type normally, even though nothing shows.]
You must now navigate to the folder with the corrupted .DS_Store file or this procedure won't correct your problem (unless it's the folder where terminal naturally opens, usually your home folder. There are two methods to accomplish this task.
-
1Method 1: Use the 'cd' (Change Directory) command along with the path to the folder in need of repair.
- To translate what you do in Finder to a written path, start by clicking 'Macintosh HD' on your desktop. This will become '/'. Click the next folder. The name will follow the '/' so type another '/' before any more folder names. For example, if the folder you are having issues with is 'Macintosh HD' -> 'Applications', the path to this folder is '/Applications'. If the problem folder was the 'Utilities' folder inside 'Applications', the path would be '/Applications/Utilities'.
- Type cd /path (example: cd /Applications) then press Return.
-
2Method 2: We can use the 'cd' command and drag the folder to terminal which automatically completes the path building process for you.
- Type cd in terminal followed by a space
- Find the folder with the issue but DON'T OPEN IT, drag its icon into terminal. Watch it complete the path for you. Press Return.
Delete the .DS_Store File
You can now remove the .DS_Store folder and all its contents with one very powerful command. The 'rm' (Remove) modified by '-f' removes all files and folders contained in the target name. DO NOT MIS-TYPE this command.
-
1Type rm -f .DS_Store and press Return. Terminal will ask for no confirmation and give no indication that this has been completed - it will only return a message if the command did not work.
-
2You should now be able to navigate to the folder in finder and the issue should be corrected.
Warnings
- .DS_Store files do not contain anything vital and can be deleted without fear of serious repercussions. Finder creates its contents as needed. The same cannot be said for everything in the operating system. Do not delete files if you do not know what they do.⧼thumbs_response⧽
- Terminal.app is an application that works entirely on text based input. A simple misspelling or accidental keystroke in Terminal can have serious consequences. Follow well documented Mac OS X Terminal procedures until you know what you are doing.⧼thumbs_response⧽
Things You'll Need
- Mac OS X 10.0 or newer.
- An Administrator account and password.