Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I bought a 2-bay QNAP NAS that I'll put 2 x 2TB hard drives in today and load up with my files. I'll be accessing the NAS via Xubuntu/Debian and Mac machines.

I'd like someone to teach me a bash one-liner (or something similar) that will clear out some of the junk files that have accumulated over the years of multi-platform access.

These include things like:

  • .ini
  • thumbs.db
  • .AppleDouble
  • .DS_Store
  • :2e*

I don't want to delete crucial metadata files, but .ini for example, I don't view as crucial and the same goes for .DS_Store.

Additionally, are there any easy ways to be proactive in the fight against spreading these junk files around? On the Mac, I did:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

a while back which should take care of future .DS_Store network spam. I'm not completely OCD but I'd like to avoid useless files where possible.

share|improve this question

1 Answer 1

up vote 2 down vote accepted
find path/to/nas \( -name '.ini' -o -name ':2e*' -o ... \) -exec rm -rf {} \;
share|improve this answer
    
Thanks very much. I'm looking forward to doing some weeding! –  boehj Jul 14 '11 at 0:00

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.