Skip to content

Instantly share code, notes, and snippets.

@josefglatz
Created September 9, 2020 16:48
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 josefglatz/ca995d5e707b08501f0ee9f7cb01bfb4 to your computer and use it in GitHub Desktop.
Save josefglatz/ca995d5e707b08501f0ee9f7cb01bfb4 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# at.supseven.jglatz.deleteapfssnapshots 1.0.0
#
# Deletes all APFS Snapshots.
# 2020 Josef Glatz
#
echo
echo "Local Snapshots:"
echo
tmutil listlocalsnapshots /
echo
echo "Deleting all Snapshots. This can take a while ..."
echo
for d in $(tmutil listlocalsnapshotdates|sed -n '1!p'); do tmutil deletelocalsnapshots $d; done
echo
echo
echo "Local Snapshots case-sensitive volume:"
echo
tmutil listlocalsnapshots /Volumes/CS
echo
echo "Deleting all Snapshots. This can take a while ..."
echo
for d in $(tmutil listlocalsnapshotdates /Volumes/CS|sed -n '1!p'); do tmutil deletelocalsnapshots $d; done
echo "DONE!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment