Last active
June 12, 2022 08:41
-
-
Save lexrus/47236a6b34fc2404dcdf to your computer and use it in GitHub Desktop.
Remove senseless files from my NAS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For me it needs to be .afpDeleted* (with an upper-case D) to work.