Created
February 27, 2012 13:58
-
-
Save magnusdahlstrand/1923948 to your computer and use it in GitHub Desktop.
Remove all ._* and .AppleDouble-files
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
Remove ._*- and .AppleDouble-files from folders. | |
Adapted from Torkel's comment on http://hints.macworld.com/article.php?story=20021118060850652 | |
Cred to hiber for suggesting adding -print0/-0 to solve whitespace issue. | |
See all ._*-files: | |
find . -name '._*' | more | |
Remove all ._*-files: | |
find . -name '._*' -print0 | xargs -0 rm | |
See all .AppleDouble-files: | |
find . -name '.AppleDouble' | more | |
Remove all .AppleDouble-files: | |
find . -name '.AppleDouble' -print0 | xargs -0 rm -rf | |
Remove all Thumbs.db-files: | |
find . -name 'Thumbs.db' -print0 | xargs -0 rm |
Just use double quotes. Then you don't need xargs:
find . -name '._*' -exec rm "{}" \;
find . -name '.DS_Store' -exec rm "{}" \;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice one! Thanks :)