Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I want to access this DB and I use this to access the SQLite DB: sqlite3 .mozilla/firefox/profile_name/places.sqlite

The query that I want to execute to this DB and store the output in a text file is SELECT moz_places.url FROM moz_places

How do I do that?

share|improve this question
up vote 9 down vote accepted
  1. Try man sqlite
  2. You'll find that sqlite expects a syntax such as sqlite [options] filename [SQL]
  3. Then do this sqlite [options] filename [SQL] > file_with_results.txt and the result would be in file_with_results.txt

From what you write, I believe you need:

sqlite .mozilla/firefox/profile_name/places.sqlite "SELECT moz_places.url FROM moz_places;" > file_with_results.txt
share|improve this answer
sqlite3 package is required so the above commands with sqlite3 instead of sqlite works – Nitin Venkatesh Jun 5 '11 at 16:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.