www.flickr.com
Petri Lopia's items Go to Petri Lopia's photostream

How to delete useless stuff OS X

If you want to find empty folders you just have to use find.

This one will just print those empty folders and doesn’t delete anything:

find /where/youwant/tostart -depth -type d -empty -print

If everything looked OK then you can do that same search and delete those folders:

find /where/youwant/tostart -depth -type d -empty -print -exec rmdir {} \;

All OS X Users have seen those pretty useless and annoying .DS_Store files so we can use that same find here.

First we just search and print those file locations to your screen:

find /where/youwant/tostart -name ".DS_Store" -depth -type f -print

And if everything looked OK we can do that again and delete those files:

find /where/youwant/tostart -name ".DS_Store" -depth -type f -print -exec rm {} \;

Thanks to Michael Ace about these tips.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>