Skip to content

Instantly share code, notes, and snippets.

@daz
Created Apr 26, 2019
Embed
What would you like to do?
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