Skip to content

Instantly share code, notes, and snippets.

@daz
Created April 26, 2019 07:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daz/5b380ba3c17bfea9f303208a80ca8d7e to your computer and use it in GitHub Desktop.
Save daz/5b380ba3c17bfea9f303208a80ca8d7e to your computer and use it in GitHub Desktop.
Clean macOS dotfiles from a USB
# Remove invisible dotfiles from a directory or USB drive
# Usage:
# cd /Volumes/MY_USB
# clean_usb.sh
dot_clean $(pwd)
rm -rf .fseventsd
rm -rf .TemporaryItems
rm -rf .Trash-*
rm -rf .Trashes
rm -rf ._.Trashes
rm -rf ._.*
rm -rf .DS_Store
# Remove .Spotlight-V100
sudo mdutil -X $(pwd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment