Skip to content

Instantly share code, notes, and snippets.

@flipphillips
Last active July 19, 2020 19:13
Show Gist options
  • Save flipphillips/ae200a3269ba714b8733fff0e1269cc8 to your computer and use it in GitHub Desktop.
Save flipphillips/ae200a3269ba714b8733fff0e1269cc8 to your computer and use it in GitHub Desktop.
cleans up SQL database of macOS downloads
#!/bin/bash
echo "Before..."
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | awk NF
echo "Churning..."
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'vacuum LSQuarantineEvent'
echo "After..."
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | awk NF
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment