Finder automatically places. DS_Store files in every folder you open.. DS_Store files are created by the Finder during normal use. These files contain display options, including icon position, window size, window backgrounds, and many other properties. These files, however, are hidden and cannot be seen normally by the user.. DS_Store files can get corrupted and cause strange Finder behavior when opening the folder containing them. Corrupted. DS_Store files can cause problems such as flashing windows that open and close, the inability to see some icons, sort icons or change folder view options.
Steps
Step 1. To delete a corrupt. DS_Store file you need to use the Terminal application
To do this, you will need to log in to Mac OS X as an administrator.
Step 2. Open the Terminal
-
Open a new finder window and navigate to the Applications folder on the left. Alternatively, in the "Finder" menu next to the Apple logo at the top left of the screen, select the "Go" menu and click on "Applications".
-
Inside the Applications folder, almost at the bottom, there is the "Utilities" folder. Open the folder.
-
Find and double click on the "Terminal" application with the left mouse button to open it.
Step 3. Get super-user (root) permissions in the terminal so you can use the commands needed to delete some files from the. DS_Store
You can do this by typing the command "sudo" (Switch User + Do).
-
In the terminal type the following commands: sudo ls (all lowercase) and press Enter on the keyboard.
-
The terminal will ask you for the root password. If the root account does not have a password, leave this field blank. Note: For security reasons, unlike Windows, Mac OS X will not show the password characters as they are typed. However, to enter the password, all you have to do is type normally.
Method 1 of 2: Navigate to the folder containing the corrupt. DS_Store file
At this point, you need to enter the folder containing the corrupt. DS_Store file, otherwise the procedure will not be successful (unless it is the default command prompt path, which is usually your Home folder. There are two ways to do this.
Step 1. Method 1:
use the command “cd” (Change Directory) + the path of the folder to open.
- To find out the path of an open folder in the Finder, click on Macintosh HD on the desktop. A slash (/) will appear. Click on the next folder. The name will appear after the slash. So, type another slash before adding folders to the file path. For example, if the folder in question is “Macintosh HD” -> “Applications”, the folder path will be “/ Applications”. If the folder in question is the "Utilities" folder, which is located within the applications folder, the file path will be "Applications / Utilities". Center | 550px
- Type -> cd / path - (example: cd / Applications) and press Enter.
Step 2. Method 2:
We can use the "cd" command and drag a folder into the terminal to automatically copy the file path of the folder after the command typed.
-
Type "cd" in Terminal followed by a space.
- Find the folder you want to open but DO NOT OPEN it. Simply drag the folder icon to the Terminal. The file path will now appear in the terminal after the "cd" command. Hit enter.
Method 2 of 2: Delete the. DS_Store file
You can now remove the. DS_Store folder and all its contents using a simple, powerful, command. The “rm” (Remove) command followed by the “-f” flag removes all files and folders contained in the file path. MAKE SURE YOU TYPE this command CORRECTLY.
Step 1. Type “rm –f. DS_STore” and press Enter
The terminal will not ask for confirmation, nor will it give any indication of the success of the operation - all you will receive will be an error message if the command did not work.
Step 2. You should now be able to open the folder in the Finder without any problems
Advice
-
Glossary of terminal commands used in this document.
-
sudo ls
- sudo: or “Switch User and Do”. Through the "sudo" we are able to perform any operation as root. This way, access denied errors and allowed errors will not get in the way of our work. On Mac OS X this command takes effect until the Terminal window you were working on is closed.
- ls stands for “List” and produces a list of all the files and folders contained in the folder we are in. In the guide we used this command in order to have a non-invasive command to use as an example of using the "sudo" command.
-
CD
- cd: stands for “Change Directory” and is used to navigate through the folders on the computer.
- File path: the path is the extended address of the folder we want to open. Some abbreviations include ~ for the active user's home folder and "/" for "Macintosh HD". Eg: cd ~ is the shortened version of cd / Users /
-
rm -f
- rm: means “Remove” and is used to delete files.
- -f: this type of command is called "flag" and is used to modify the execution of a command. In this case, the "-f" flag tells the "rm" command to force the deletion of the file, ignoring permissions and errors. If we wanted to delete a folder we should also use the "-r" flag, which means "recursive", that is, it will delete anything inside the folder. Therefore, be VERY careful when using the –r flag.
- File: This is nothing but the file to be deleted.
Warnings
- Terminal.app is an application that only works in text mode. A simple typo in Terminal can cause serious consequences. Follow the well-documented Mac OS X terminal procedures until you know exactly what you are doing.
- . DS_STore files do not contain critical data and can be deleted without fear of serious consequences. The Finder will re-create the file if and as needed. The same cannot be said for many other operating system files. So don't delete files unless you know exactly their function and importance.
-