How to dump the Firefox history (Linux)

Not pretty, but gets you there:

  • Find and go to your Firefox profile (usually you can locate by going to “~/.mozilla/firefox/*.default”).
  • Run “sqlite3 places.sqlite .dump | grep moz_places”

If Firefox is running you may have to copy the “places.sqlite” to a new file then run the “sqlite3” against it. You can’t dump it while Firefox is running because it locks the database.

Since it’s SQL there are fancier ways of pulling the actual tables, but for a quick script, this will do.

Note if you’re after the time that a URL was accessed (I was), it seems to be the last field in the “VALUES”. It is is in microseconds since 1970. In that case, this little Perl snippet should get you the actual time:

where “HISTORYTIME” is replaced by the time printed in the SQL dump (eg: a big arse number like “1373383738987790”).

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *