5

Possibly related to this question: Can I view Firefox history with the terminal?

I want to create a shell script that clears everything in my Firefox's history (this includes the other histories such as cache) in order to have a clean copy to backup before installing the next Ubuntu version or just to have. The question is how to do this via command line so I can add those lines to my script.

I'm okay with a command line command via BleachBit also, if possible.

3 Answers3

6

This short command cleans Firefox backups, cache, cookies, crash reports, DOM storage, download history, form history, passwords, session restore, site preferences, and URL history (as of BleachBit 1.8):

bleachbit --clean firefox.*

(See also BleachBit documentation: command-line)

Andrew
  • 1,575
2

If you want to erase the history from Firefox, use cd in the Terminal to where all the sqlite files are stored, following the instructions in the link you provided. The following code will erase the relevant table:

sqlite3 places.sqlite "DELETE FROM moz_historyvisits;"
Chris Duncan
  • 293
  • 1
  • 2
  • 9
1
  • This link tells you where your history.dat is located in your profile and so you can delete that.

    Browsing History: history.dat
    Saved Form Information: formhistory.dat
    Download History: downloads.rdf
    Cookies: cookies.txt
    Cache: cache (& trash cache) (folders!)

  • To find your profile folder: Go to Help menu, Troubleshooting information. Near the top will say "Profile Folder" and a button called "Show Folder".

  • The same troubleshooting info is available via the URL: about:support. Just type that in the address bar.
Bulrush
  • 802