Skip to content

Instantly share code, notes, and snippets.

@moisoto
Last active July 10, 2024 20:22
Show Gist options
  • Save moisoto/f80d18cb277592cc1e3de66a77d4f135 to your computer and use it in GitHub Desktop.
Save moisoto/f80d18cb277592cc1e3de66a77d4f135 to your computer and use it in GitHub Desktop.
MacOS - Free Disk Space by deleting Time Machine Local Snapshots

How to delete Time Machine Local Snapshots and free your Disk Space

List local snapshots:

tmutil listlocalsnapshots /

You will be presented with a list of snapshots like this:

Snapshots for disk /:
com.apple.TimeMachine.2021-02-10-151840.local
com.apple.TimeMachine.2021-02-10-161441.local
com.apple.TimeMachine.2021-02-10-171501.local
com.apple.TimeMachine.2021-02-11-100416.local
com.apple.TimeMachine.2021-02-11-105919.local
com.apple.TimeMachine.2021-02-11-124545.local
com.apple.TimeMachine.2021-02-11-151804.local

Erase each specific snapshot

sudo tmutil deletelocalsnapshots 2021-02-10-151840

Use this command to generate a script that will erase all your local snapshots:

# Generate Script
tmutil listlocalsnapshots / | awk 'BEGIN{FS="."} {if($4!="") print "tmutil deletelocalsnapshots " $4}' > delete_snapshots.sh

# Give Execution Permissions to the script
chmod 744 delete_snapshots.sh

# Remember to run your script with sudo
sudo ./delete_snapshots.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment