Super User is a question and answer site for computer enthusiasts and power users. 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

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 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
up vote 3 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


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.