Skip to content

Instantly share code, notes, and snippets.

@jasonrm
Created July 20, 2009 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonrm/150495 to your computer and use it in GitHub Desktop.
Save jasonrm/150495 to your computer and use it in GitHub Desktop.
Empty ZFS trash on Mac OS X
#!/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