Skip to content

Instantly share code, notes, and snippets.

@chesterbr
Created May 8, 2012 15:55
Show Gist options
  • Save chesterbr/2636602 to your computer and use it in GitHub Desktop.
Save chesterbr/2636602 to your computer and use it in GitHub Desktop.
Script that cleans up Firefox data files on Mac OS X, useful for "old" installs that get slower with time. I used Automator.app to make it run when I login, so whenever I reboot the computer I get a fresh, snappier Firefox!
#!/bin/bash
# Closes any running Firefox (you'd better close it manually,
# but this is a safeguard)
killall firefox
# Defragments all databases. A few will result in "Error: file
# is encrypted or is not a database". It's fine, they will be
# skipped and no harm will be done.
for f in ~/Library/Application\ Support/Firefox/Profiles/*/*.sqlite; do sqlite3 "$f" 'VACUUM;'; done
# Reopens Firefox - comment with '#' if you don't want it to happen
open /Applications/Firefox.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment