Skip to content

Instantly share code, notes, and snippets.

@lexrus
Last active June 12, 2022 08:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lexrus/47236a6b34fc2404dcdf to your computer and use it in GitHub Desktop.
Save lexrus/47236a6b34fc2404dcdf to your computer and use it in GitHub Desktop.
Remove senseless files from my NAS
#!/bin/bash
find . -name '*.DS_Store' -type f -delete;
find . -name 'Thumbs.db' -type f -delete;
find . -name '*.swp' -type f -delete;
find . -name '*.AppleDouble' -exec rm -rf {} \;
find . -name ".AppleDouble" -print0 | xargs -0 rm -rf;
find . -name ".TemporaryItems" -print0 | xargs -0 rm -rf;
find . -name ".Trashes" -print0 | xargs -0 rm -rf;
find . -name ".afpdeleted*" -print0 | xargs -0 rm -rf;
@marco-schmidt
Copy link

For me it needs to be .afpDeleted* (with an upper-case D) to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment