-1

is there a way possible with terminal pipelining to sort the bookmarks Mozilla Firefoxstores in alphabetical order?

I tried dabbing a little but to my disappointment ,the bookmarks are stored in JSON format ,how do you extract things from that ?

2 Answers 2

2

If you state what your final goal is, you will get better answers. You can get a somewhat clean list of sorted URLs from a JSON file with something like:

sed 's/,/\n/g' bookmarks-2012-07-07.json | grep '"uri"' | grep http | cut -d '"' -f 4 | sort

Your most powerful option is to utilize sqlite3 to get the bookmarks from the file places.sqlite from your home directory.

4
  • wow ,is that the regex power coming into picture or am i missing something ? Jul 8, 2012 at 8:14
  • Assume his computer with Firefox only boots up in console mode now, no GUI. But he still wants to sort his bookmarks alphabetically with what he has. There you have it ;)
    – ish
    Jul 8, 2012 at 8:18
  • i know it will be too much to ask but can you just explain how does that work out ? Jul 8, 2012 at 8:19
  • sed is a powerful stream editor, used above only to substitute one string with another. You can utilize regex with sed, but the example given doesn't do that much (even though a single character typically does qualify as a REGEX). Jul 8, 2012 at 8:21
2

If you simply want to sort the bookmarks in Firefox alphabetically, it's very easy to do and no command-line magic is necessary.

  1. Press Ctrl+Shift+O (<--letter O) to open the Bookmarks Library.

  2. Navigate to the folder you want to sort, right-click on it and click on "Sort by Name":

    enter image description here

  3. Those bookmarks will be sorted alphabetically. Notice the before/after difference:

    enter image description here

3
  • Well thats not what i wanted izk ,but thanks anyways ,i wanted to do it via terminal Jul 8, 2012 at 8:13
  • OK, fixed the title for you.
    – ish
    Jul 8, 2012 at 8:17
  • Note that the backups are in json, the actual bookmarks are stored in places.sqlite as Marios explained in his answer.
    – ish
    Jul 8, 2012 at 8:20

You must log in to answer this question.

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