使用Linux处理places.sqlite文件

时间:2011-11-28 22:15:35

标签: linux firefox

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

2 个答案:

答案 0 :(得分:4)

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

之类的操作

答案 1 :(得分: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.