Is it possible to view Google Chrome bookmarks and history by using command line?
Ubuntu – Is it possible to view Google Chrome bookmarks and history from the terminal
command line
Related Solutions
Google Chrome has these stable options. There are other non stable ones, but they can be added and removed whenever the developers want, so I haven't included them, to keep this up to date.
I have written the option, then example, then explanation.
--user-data-dir=DIR
google-chrome --user-data-dir=/home/tim/chromedatadir
This is used to tell google chrome where to save your data (bookmarks, history, anything peronalised to you). This is the way to create a new session - just running google-chrome
simply opens a new tab. Use a directory you have just created. The default is ~/.config/google-chrome
.
--app=URL
google-chrome --app=http://google.co.uk
This creates a new window with no tool bars - e.g. No bookmarks bar, or tab bar or omnibar. See the screenshot below (that is Google, I just have a custom background 1).
--incognito
google-chrome --incognito
Opens an incognito window.
Pages that you view in incognito tabs won’t stick around in your browser’s history, cookie store or search history after you've closed all of your incognito tabs. Any files that you download or bookmarks that you create will be kept.
As you can see (top right) all my extensions (except ad block, because I have enabled that) are disabled in incognito.
--proxy-server=host:port
google-chrome --proxy-server="socks5://foobar:66"
This specifies the HTTP/SOCKS4/SOCKS5 proxy server to use for requests. It overrides any environment variables or settings picked via the options dialog, via the GUI settings. An individual proxy server is specified using the format:
[<proxy-scheme>://]<proxy-host>[:<proxy-port>]
<proxy-scheme>
is the protocol of the proxy server, and is one of the following 4:
"http", "socks", "socks4", "socks5"
--no-proxy-server
google-chrome --no-proxy-server
Disables the proxy server. Overrides any environment variables or settings picked via the GUI settings.
--proxy-auto-detect
google-chrome --proxy-auto-detect
Autodetect proxy configuration. Overrides any environment variables or settings picked via the GUI settings.
--proxy-pac-url=URL
google-chrome --proxy-pac-url=URL
Specify proxy auto configuration URL. Overrides any environment variables or settings picked via the GUI settings.
--password-store=<basic|gnome|kwallet>
google-chrome --password-store=gnome
Set the password store to use. The default is to automatically detect based on the desktop environment. basic
selects the built in, unencrypted password store. gnome
selects Gnome keyring. kwallet
selects (KDE) KWallet
. (Note that KWallet
may not work reliably outside KDE.)
--version
google-chrome --version
(return Google Chrome 36.0.1985.143
)
Shows version information.
Perhaps more useful is
echo 'google-chrome --version' | sed -nre "s/.* ([0-9.]+)/\1/p"
(return 36.0.1985.143
)
As that returns just the version number, without Google Chrome
at the beginning.
There is more information here about ways of manipulating the --version
option.
My "recently" is 5 minutes =)
recently=5
find . -type f -amin "$recently"
Breakdown
find
search for files in a directory hierarchy
.
search in the current folder and all subfolders
-type f
search only fort files
-amin 5
File was last accessed 5 minutes ago.
Or perhaps you mean the recently used files in your Desktop Environment, than you need something like
awk -F"file://|\" " '/file:\/\// {print $2}' ~/.local/share/recently-used.xbel
Breakdown
awk
pattern scanning and text processing language
-F"file://|\" "
define two field separators,
file://
and"
/file:\/\//
only lines with
file://
are interesting{print $2}
the path is in column 2
Best Answer
The Bookmarks is a UTF-8 plain text file in
JSON
format:google-chrome-beta
Depending on your version of Chrome
Default
Depending on your profile
To view the bookmars use this command:
or with
jq
, a lightweight and flexible command-line JSON processor:and run with this command to see the whole structure:
or with this command to see an entry, eg.
checksum
:or all bookmarks in the bookmark bar:
The History is a binary file in
SQLite format 3
:google-chrome-beta
Depending on your version of Chrome
Default
Depending on your profile
To query the database, Chrome must be completely closed. Or you have to create a copy of the file and use that copy.
To view the history you need to install sqlite3:
Start sqlite3 with:
and list all tables:
or to see all downloads:
Alternatively, a GUI may be used:
sqlitebrowser
and start with:
sqliteman
:and start with: