Getting Browser History in Chrome

I mean, through command line.

It is surprisingly simple, at least in Linux.

First find the location of the user profile of the Chrome browser. There is a file History that is a sqlite3 database containing all the browsing history of this user.

Then, if there is no available sqlite client, install

1
apt-get install sqlite3

Just make sure to use sqlite3 instead of sqlite2. The latter has been deprecated for a while.

Finally, do

1
sqlite3 History "select datetime(last_visit_time/1000000-11644473600,'unixepoch'),url from urls order by last_visit_time desc" > history_export.txt

References:

  1. one source
  2. an older source