Skip to content

Instantly share code, notes, and snippets.

@doyousketch2
Last active July 29, 2019 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doyousketch2/e51431ddbad208db69edc1bda7c1112b to your computer and use it in GitHub Desktop.
Save doyousketch2/e51431ddbad208db69edc1bda7c1112b to your computer and use it in GitHub Desktop.
Delete Firefox history older than 1 week - in Debian Linux - https://git.io/fjSWS
#! /bin/bash
## sudo apt update && sudo apt install sqlite3
## if you're on the Default-channel
cd ~/.mozilla/firefox/**.default/
sqlite3 places.sqlite "delete from moz_historyvisits where visit_date < strftime('%s', 'now', '-7 days') * 1000000;"
sqlite3 places.sqlite "delete from moz_places where url like '%duckduckgo%'; vacuum;"
## if you're on the Beta-channel
cd ~/.mozilla/firefox/**.default-beta/
sqlite3 places.sqlite "delete from moz_historyvisits where visit_date < strftime('%s', 'now', '-7 days') * 1000000;"
sqlite3 places.sqlite "delete from moz_places where url like '%duckduckgo%'; vacuum;"
@doyousketch2
Copy link
Author

run this clean-up script while Firefox is closed.
put it in your .bash_profile if you want it to run once at every bootup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment