Use terminal to delete the DS_store. Why all of my files disappeared?

the order is

find ~-type f-name.DS_store -delete.


All my files disappeared. All folds were empty.

MacBook Pro with Retina display, OS X Mavericks (10.9.2)

Posted on May 7, 2014 2:47 AM

Reply
2 replies

May 12, 2014 3:34 PM in response to JeromeJia

As ahi there,


as peter_watt already has written, there are spaces missing.


If you entered the command in the way you described in your message, the find command discards everything between ~ and the space before -delete. So find assumes -delete is the only parameter and thus deletes everything from the directory you are currently in downwards.


The correct parameters for the operation you wanted to execute are [without quotation marks]:


"find . -name ".DS_Store" -delete"


If you replace the "." with a "/", find searches from the top level (aka root) directory downwards. Using a "~" instead makes find search your home directory.


As a side note, it is not the best idea to remove the .DS_Store files from any OSX related directories, since those files do contain information necessary for OSX to work properly.


However, removing those files from network shares accessed by other operating systems as well can be useful.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Use terminal to delete the DS_store. Why all of my files disappeared?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.