Skip to content

Instantly share code, notes, and snippets.

@jasonrm
Created November 30, 2010 03:09
Show Gist options
  • Select an option

  • Save jasonrm/721079 to your computer and use it in GitHub Desktop.

Select an option

Save jasonrm/721079 to your computer and use it in GitHub Desktop.
zfsEmptyTrash.sh
#!/bin/sh
# If you use ZFS of Mac OS X 10.5 right now
# then you know that emptying the trash
# will not empty the trash on ZFS filesystems
# however we can do this with brute force.
list=`zfs list -o mountpoint -t filesystem | sed 1d`
for filesystem in $list
do
sudo rm -rf $filesystem/.Trashes/*
sudo rm -rf $filesystem/.Trash/*
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment