Skip to content

Instantly share code, notes, and snippets.

@mrkaspa
Created February 13, 2025 16:17
Show Gist options
  • Save mrkaspa/2bd5e91b06a0c67fb9c287d4720fd86b to your computer and use it in GitHub Desktop.
Save mrkaspa/2bd5e91b06a0c67fb9c287d4720fd86b to your computer and use it in GitHub Desktop.
Script to delete the timemachine backups in mac
#!/bin/sh
output=$(tmutil listlocalsnapshots /)
output_list=($output)
for x in "${output_list[@]:4}"; do
echo "Deleting $x"
sudo tmutil deletelocalsnapshots $(cut -d '.' -f 4 <<<"$x")
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment