Skip to content

Instantly share code, notes, and snippets.

@balibali
Created December 3, 2010 09:32
Show Gist options
  • Save balibali/726768 to your computer and use it in GitHub Desktop.
Save balibali/726768 to your computer and use it in GitHub Desktop.
Macで外部ストレージをumountする際に不要ファイルを削除するスクリプト
#!/bin/sh
if [ ! -d $1 ]; then
echo "error" 1>&2
exit 1
fi
rm -rfv \
"$1/.Spotlight-V100" \
"$1/.Trashes" \
"$1/._.Trashes" \
"$1/.fseventsd"
sudo diskutil umount "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment