Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I use these command on my storage server to clean up some junk, but it doesn't produce any output or result. I found the syntax online somewhere and just modified for which files I need it. What else do I need to add to see what is actually being deleted or total at the end? Ultimately this would be a script that will run automatically but for right now I'm running the commands manually. Thanks in advance!

find . -name .DS_Store -printf \"%p\"\ \  | xargs rm 
find . -name ._.DS_Store -printf \"%p\"\ \  | xargs rm 
find . -name Thumbs.db -printf \"%p\"\ \  | xargs rm
find . -name ._Thumbs.db -printf \"%p\"\ \  | xargs rm
share|improve this question
Is anything wrong with just changing rm to rm -v? – MadHatter Feb 18 '13 at 16:36

find also has a -delete flag. And you could also combine everything into one command, possibly saving some time:

find . \( -name .DS_Store -or -name ._.DS_Store -or -name Thumbs.db -or -name ._Thumbs.db \) -print -delete
share|improve this answer
find -print -delete is really the best way to do it. – kormoc Feb 18 '13 at 17:33

Just add the -v parameter to the rm command for verbose output, e.g.

find . -name .DS_Store -printf \"%p\"\ \  | xargs rm -v
share|improve this answer

Your Answer


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.