Skip to content

Instantly share code, notes, and snippets.

View briankendall's full-sized avatar
🧽
Please do not read this sentence.

Brian Kendall briankendall

🧽
Please do not read this sentence.
View GitHub Profile
@briankendall
briankendall / delete_all_local_snapshots.py
Created January 22, 2020 20:27
Python 2 script for deleting all local snapshots on a mac
#!/usr/bin/env python
from subprocess import call, check_output
import re
def main():
output = check_output(['tmutil', 'listlocalsnapshots', '/'])
lines = output.strip().split('\n')
for i, line in enumerate(lines):
match = re.search(r'com.apple.TimeMachine.(20\d\d-\d\d-\d\d-\d{6})', line)