Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Every time I delete it from the desktop, I get the same file ".DS_store" created after some time. Is there a reason why this happens ? And can I permanently stop it from being created ?

share|improve this question
1  
See the Wikipedia entry on .DS_Store which explains what the file does. In short, Finder writes one in each folder to track icon locations, sized and the last window position / sort / size so you see a folder the way it was next time you open it. Desktop is always visible, hence the constant recreation of this file by the Finder. –  Alex Oct 6 '12 at 14:02
    
Have you ruled out disk corruption by booting to the recovery HD and running a disk repair operation? I would also get a good backup before poking at it in any way in case it's a sign of pending disk subsystem failure. Not likely, but why risk it if you don't have regular backups. –  bmike Oct 6 '12 at 14:04
    
@Alex so theres no way to hide that particular file type ?? –  Render Oct 6 '12 at 15:37
    
@bmike my laptop is about 2 months old, I really hope its not a pending disk subsystem failure already !!! –  Render Oct 6 '12 at 15:37
    
@Fendi, see this Superuser question as well. –  Alex Oct 6 '12 at 15:40

3 Answers 3

up vote 3 down vote accepted

Type this in Terminal (/Applications/Utilities/Terminal.app):

defaults write com.apple.finder AppleShowAllFiles FALSE

killall Finder

The first command sets the hidden files visibility to hidden; the second one forces Finder to restart, action that is needed in order to make it take in consideration the previous command.

You can also log out/reboot instead of killing the Finder, but the first command is needed to change a hidden preference (one that the Finder can’t change using the normal Finder view options or preferences).

share|improve this answer
1  
Would like an explanation please –  Render Oct 6 '12 at 13:37
1  
The answerer is guessing that your finder somehow was set to show hidden files. It is the most logical explanation for why a file that normally is hidden by Finder would show, but you would also expect to see .DS_Store files everywhere if this were the case. –  bmike Oct 6 '12 at 14:02
    
@Fendi The first command sets the hidden files visibility to hidden; the second one forces Finder to restart, action that is needed in order to make it take in consideration the previous command. –  Alex Oct 6 '12 at 14:07
    
Guess the only way to do it is to hide the hidden files or live with it .. –  Render Oct 6 '12 at 15:42

.DS_Store is used by OS X to store directory information used by Finder such as icon position, etc.

In OS X any file name that starts with a "." is hidden, so to hide the .DS_Store file you can use the terminal command:

sudo defaults write com.apple.finder AppleShowAllFiles NO

Basically, you can ignore it. If you are copying a directory to a flash drive and looking at it in Windows, feel free to just delete it. It is Mac OS X Finder that creates this file whenever it opens a new directory.

share|improve this answer

Apparently, it was due to an old Safari update that accidentally showed the .DS_Store file.

share|improve this answer

This post does not cite any references or sources. Please help improve this post by adding citations to reliable sources. Unsourced material may be challenged and removed.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.