-
-
Save Roarcannotprogramming/91828acebc119e9927082918db3fe8a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tmc() { | |
before=$(df -hl / |awk '{print $3}' |tail -n1) | |
count=0 | |
for snapshot in $(tmutil listlocalsnapshots /|awk -F. '{print $4}');do | |
let 'count++' | |
echo "delete snapshot $snapshot" | |
tmutil deletelocalsnapshots $snapshot; | |
done | |
after=$(df -hl / |awk '{print $3}' |tail -n1) | |
if [[ $count -ne 0 ]]; then | |
echo "Total $count snapshot(s) deleted, Size change: $before ===> $after" | |
else | |
echo "No snapshot deleted" | |
fi | |
} | |
function tml() { | |
tmutil listlocalsnapshots /|awk -F. '{print $4}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment