Skip to content

Instantly share code, notes, and snippets.

@tygor
Created December 18, 2013 01:46
Show Gist options
  • Save tygor/8016055 to your computer and use it in GitHub Desktop.
Save tygor/8016055 to your computer and use it in GitHub Desktop.
I like a clean file system. Especially when I publish folders to the web. I found this nice little trick to remove all Mac hidden files recursively. Put it in the parent folder and it will remove all .DS_Store and ._some-file-name.ext files.
#!/bin/bash
echo
echo Deleting all .DS_Store and ._* files that Mac puts all over your system
echo
find . -name ".DS_Store" -print0 | xargs -0 rm -rf
find . -name "._*" -print0 | xargs -0 rm -rf
echo
echo " _ _ _ ____ _ "
echo " / \ | | | | _ \ ___ _ __ ___| |"
echo " / _ \ | | | | | | |/ _ \| '_ \ / _ \ |"
echo " / ___ \| | | | |_| | (_) | | | | __/_|"
echo "/_/ \_\_|_| |____/ \___/|_| |_|\___(_)"
echo Back to you...
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment