2011-11-28 69 views
1

Firefox将整个故事存储在该文件中,我想要做的是在其中找到包含特定关键字的链接,但是我所尝试的并不是太精确,并且给了我很多混沌输出:grep --binary-files = text关键字/path/to/places.sqlite。我想知道在Linux上使用工具处理该文件并找出所有使用关键字的链接的最佳方法是什么?使用Linux处理places.sqlite文件

回答

4

您用sqlite打开它。用你最喜欢的包管理器安装sqlite并运行sqlite3 places.sqlite。然后您可以对数据执行SQL查询。开始.schema,那么你可以做这样的事情select * from moz_places where url like '%google%';

0

试试这个:

wget -cq https://raw2.github.com/websafe/ffbx/master/ffbx.sh \ 
    && sh ffbx.sh 

或者只是下载ffbx.sh,并用它作为README描述。

没有任何参数ffbx将搜索〜/ .mozilla/firefox子目录中找到的所有places.sqlite文件。

ffbx.sh 

的示例的结果:

1391725993809844  ffbx-example Bookmarks Toolbar  https://www.mozilla.org/en-US/firefox/central/ Getting Started 
1391725993811277  ffbx-example Mozilla Firefox https://www.mozilla.org/en-US/firefox/help/  Help and Tutorials 
1391725993812029  ffbx-example Mozilla Firefox https://www.mozilla.org/en-US/firefox/customize/  Customize Firefox 
1391725993812829  ffbx-example Mozilla Firefox https://www.mozilla.org/en-US/contribute/  Get Involved 
1391725993813492  ffbx-example Mozilla Firefox https://www.mozilla.org/en-US/about/ About Us 
1391725993870487  ffbx-example Bookmarks Toolbar  place:sort=8&maxResults=10  Most Visited 
1391725993870988  ffbx-example Bookmarks Menu place:folder=BOOKMARKS_MENU&folder=UNFILED_BOOKMARKS&folder=TOOLBAR&queryType=1&sort=12&maxResults=10&excludeQueries=1 Recently Bookmarked 
1391725993871436  ffbx-example Bookmarks Menu place:type=6&sort=14&maxResults=10  Recent Tags 
1391726063106065  ffbx-example Unsorted Bookmarks  https://github.com/websafe/ffbx websafe/ffbx · GitHub Firefox,bookmarks,extract,Bash,script,SQLite 

输出包含用于每个书签TAB分隔的列:

  • 修改时间戳,
  • 配置文件名称,
  • 书签文件夹,
  • url,
  • 标题,
  • 标签。

当与参数一起使用:

ffbx.sh /path/to/places.sqlite 

输出是相同的,但profile name柱丢失:

1391725993809844  Bookmarks Toolbar  https://www.mozilla.org/en-US/firefox/central/ Getting Started 
1391725993811277  Mozilla Firefox https://www.mozilla.org/en-US/firefox/help/  Help and Tutorials 
1391725993812029  Mozilla Firefox https://www.mozilla.org/en-US/firefox/customize/  Customize Firefox 
1391725993812829  Mozilla Firefox https://www.mozilla.org/en-US/contribute/  Get Involved 
1391725993813492  Mozilla Firefox https://www.mozilla.org/en-US/about/ About Us 
1391725993870487  Bookmarks Toolbar  place:sort=8&maxResults=10  Most Visited 
1391725993870988  Bookmarks Menu place:folder=BOOKMARKS_MENU&folder=UNFILED_BOOKMARKS&folder=TOOLBAR&queryType=1&sort=12&maxResults=10&excludeQueries=1 Recently Bookmarked 
1391725993871436  Bookmarks Menu place:type=6&sort=14&maxResults=10  Recent Tags 
1391726063106065  Unsorted Bookmarks  https://github.com/websafe/ffbx websafe/ffbx · GitHub Firefox,bookmarks,extract,Bash,script,SQLite, 

Check the README for more examples.