Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes I would like to find a bookmarked URL for pasting it to a friend to Jabber (mcabber). Loading Firefox for that, then immediately closing it seems hugely overkill, I'd rather have a Linux CLI app that dumps all bookmarks to stdout and filter the results through grep. Of course, I can solve this by giving up completely on using bookmarks in Firefox and just save links to a simple text file, but I already have many ones.

Is there such a CLI app that can process a Firefox profile and dump bookmarks?

Should I instead aim to try automating somehow the export of Firefox bookmarks to a simpler (ideally plain text) format when it closes?

share|improve this question
up vote 1 down vote accepted
sqlite3 places.sqlite "select moz_places.url, moz_bookmarks.title
                       from moz_places, moz_bookmarks
                       where =
                       and moz_bookmarks.type = 1
                       and length(moz_bookmarks.title) > 0
                       order by moz_bookmarks.dateAdded"

(Note: I suck at SQL.)

Add -line, -html, -separator " | ", or -separator $'\t' for alternate output formats.

share|improve this answer

The link below will automatically get you HTML and not plain text but it seems to work fine (I'm using 7.0.1) and you could probably use grep to parse out what you want.

Which in a nutshell says to
use about:config (typed in the address bar) to set "browser.bookmarks.autoExportHTML" to true.

Update: I tried
grep -i http <PathToProfile>/bookmarks.html | awk '{print $2}'
and got a nice listing of bookmarked pages. This may take some tweaking and playing around but it works great.

share|improve this answer
awk '/http/{print $2}' – grawity Oct 19 '11 at 11:27
Man I wish I took the time to understand awk better. Everything I have ever seen amazes me but it has never tipped the scales of actually making time to learn it. – Dennis Oct 19 '11 at 11:55

The booknarks are already in html-format (with additional information) in your ~/.mozilla/firefox/xyz.default/bookmarks.html (xyz is some other string in your directory).

share|improve this answer
My fresh install of Firefox (7.0.1) stores them in places.sqlite and only exports them on demand unless you set it to do so automatically. – Dennis Oct 18 '11 at 21:19
@Dennis: Where do you set it to do automatically? – vtest Oct 24 '11 at 10:10
@vtest: in about:config there is a key browser.bookmarks.autoExportHTML. Checkout the other keys containing bookmark too. – ott-- Oct 24 '11 at 11:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .