Skip to content

Instantly share code, notes, and snippets.

@therevoman
Forked from RLovelett/delete.sh
Created September 25, 2020 22:33
Show Gist options
  • Select an option

  • Save therevoman/63b17630c04aab1f5d989ce18336be6b to your computer and use it in GitHub Desktop.

Select an option

Save therevoman/63b17630c04aab1f5d989ce18336be6b to your computer and use it in GitHub Desktop.
Delete ZFS snapshots from dataset one-liner
zfs list -r -H -t snapshot -o name stream/lxc/stash | xargs -n1 zfs destroy
@therevoman
Copy link
Author

I like that one (to be selective, I have 3 pools on my pc):
zfs list -r -H -t snapshot -o name | grep <poolname/whatever> | xargs -n1 zfs destroy

zfs destroy -rvn dataset_or_zvol_name@%
remove -n to actually run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment