Linux Blog

Clear browser history from command prompt

Filed under: General Linux,Quick Linux Tutorials — at 3:36 pm on Thursday, January 17, 2008

I found this link a while back on clearing the history in IE7 from the command prompt

Clear IE7 browsing history from the command line

Although not specifically Linux related it is interesting and I thought users who sometimes use IE7 may be interested in this. It also provoked me to ask the question “How do I clear FireFox history from command line.”

Well, it is a bit simpler then clearing your history in IE7. The only thing you need to know is your profile name, and even then you don’t really have to because you can guess.

Firstly there are a couple of files that you should be aware of they are: cookies.txt, downloads.rdf, history.dat and one folder full of files: <profile>/Cache/

Now to clear your downloads list, your cookies list, your history or your cache you basically just remove the corresponding file. So, lets take a look at the command. We’ll assume my randomly generated profile name is called linux-blog

owen@linux-blog:~$ rm .mozilla/firefox/linux-blog.default/cookies.txt
owen@linux-blog:~$ rm .mozilla/firefox/linux-blog.default/Cache/*
owen@linux-blog:~$ rm .mozilla/firefox/linux-blog.default/downloads.rdf
owen@linux-blog:~$ rm .mozilla/firefox/linux-blog.default/history.dat

The above need to be ran individually. Make sure that FireFox is closed before the above is ran, or some pages may not load correctly. If any one is interested I’ll write a shell script to make this easier.