10

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?

Nitin Venkatesh
  • 21,993
  • 11
  • 68
  • 91

1 Answers1

15
  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
Marco Ceppi
  • 47,783
  • 30
  • 172
  • 197