Skip to content

Instantly share code, notes, and snippets.

@storskegg
Created January 11, 2022 16:47
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 storskegg/67fbb48701043a60d1603d060431123c to your computer and use it in GitHub Desktop.
Save storskegg/67fbb48701043a60d1603d060431123c to your computer and use it in GitHub Desktop.
Deletes all local Time Machine backups in MacOS 12.1 (and maybe other versions)
#!/bin/sh
# list local snapshots for `/`, filter output to grab snapshot timestamps, and pass them one at a time to tmutil
# to delete them.
#
# you may need to elevate your privelleges using sudo, but i found that on my single user laptop i didn't have to
tmutil listlocalsnapshots / | grep -Eo '\d\d\d\d-\d\d-\d\d-\d+' | xargs -n1 tmutil deletelocalsnapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment