Is there an easy way to backup Firefox bookmarks to a file with command line. Running a find command, I managed to find this file: /.mozilla/firefox/9a5j5dbb.default/bookmarkbackups/bookmarks-2013-05-22.json which appears to have my latest data. However, I dont know if the folder under Firefox (currently 9a5j5dbb.default) will keep changing, and I'm pretty sure the date will.

Rather than a more advanced shell script to dynamically calculate the path based on today's date and looking for the only xxxxx.default folder under ~/.mozilla.

Is there a simpler/more-robust way to save/copy your current Firefox bookmarks to a specified file?

  • 1
    The folder named 9a5j5dbb.default is the Profile Folder of your Firefox. It won't change unless you re-install Firefox/Ubuntu. If you delete this folder, Firefox would create another randomly-generated-named folder for your Profile.
    – Aditya
    May 23, 2013 at 14:09

3 Answers 3


Using sqlite:

Firefox uses sqlite to store its data. Bookmarks are stored in ~/.mozilla/firefox/profile_name/places.sqlite. So we can use sqlite to backup and restore Firefox bookmarks.

Hit Ctrl+Alt+T to open terminal and run following command to install sqlite3:

apt-get install sqlite3

Now you can one following command to backup/restore Firefox bookmarks, make sure to close Firefox before running any of following commands.


sqlite3 ~/.mozilla/firefox/user.profile/places.sqlite ".backup /path/to/directory"


sqlite3 ~/.mozilla/firefox/user.profile/places.sqlite ".restore /path/to/backup/file"

Change user.profile with your default profile name.

Simple Backup:

If you don't want to install any additional packages use following command to copy latest bookmarks backup from Firefox profile:

cp $(find ~/.mozilla/firefox/fvy8ug06.default/bookmarkbackups | sort | tail -n1) .
  • Whilst this is probably the most 'proper' way to do things in the command shell, I still prefer Mr Seeds solution for 3 main reasons: 1) This rquired me to install sqlite3 2) This saved in a non-human readable format rather than the json format fo the other solution 3) This command was far less 'flexible' and I had to plug in an absolute path name for sqlite to work. Something like ~/data did not work. However, thank you for your input, and perhaps others will prefer to use this solution. May 24, 2013 at 12:00
  • @Programster - I suppose that, by "Mr Seeds" you mean Gaurav Sharma, because only him is the one who posted the JSON-related answer. I suppose also that he must have been changed his name/alias after your comment. Oct 20, 2016 at 19:09
  • +1 for the Simple Backup solution which includes "copy the latest json file".
    – wedi
    Nov 5, 2018 at 8:51

Well since there is only one .default in that folder you could use a wildcard like this:


sudo cp -fr /Path/to/Source/Folder/*.default /Path/to/Destination/Folder

  • This seems like the most appropriate answer so far because I can run it from the shell. I guess I just have to use this and pick the alphanumeric .json file to get the latest one. I was rather hoping I could run something like firefox --dump-bookmarks /my/folder/loc/bookmarks.json May 23, 2013 at 15:00
  • 1
    It's not necesary to use sudo as the profile folder is in $HOME. If sudo is used to make the copy, root will own the copied files, unless you of course used the -a switch with cp to preserve ownership.
    – user76204
    May 30, 2013 at 22:39

In mozilla there is a option for taking the Backup of Bookmarks in JSON format.

You can follow these steps:-

  1. open all bookmarks (shift+ctrl+o)

  2. select 'Import and Backup' option (alt+i)

  3. Select 'Backup' option

here you can get all bookmark backup in json format.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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