Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to get the profile directory of the default firefox profile (the one that opens automatically) from Bash. How could I proceed? I can't find any useful options issuing firefox --help

share|improve this question
    
you can du a firefox; sudo lsof | grep [username] | grep firefox | grep profile which would get a firefox instance running. lsof will show you the opened files; grep will filter you out the interesting parts of lsof. This will quickstart the info + needs some fine-tuning. What do you need the information for anyhow? Do you wanna put some stuff automatically in a firefox profile folder - why? –  humanityANDpeace Jan 10 '13 at 13:22
    
I want to get the firefox decmod.db file, because it is needed for a Java web application. For some reason, it works out of the box on Windows, but a configuration file with the path to the decmod.db file should be placed at home on Linux. I want to generate this file automatically. –  Jorge Suárez de Lis Jan 10 '13 at 16:17
    
Sorry, can't edit my previous comment. Your proposal "works", but I want to place this on a session start script (for several reasons, it's the only place that makes sense) and I don't want to run firefox on each session start. –  Jorge Suárez de Lis Jan 10 '13 at 16:26

2 Answers 2

up vote 1 down vote accepted

Try cat ~/.mozilla/firefox/profiles.ini | grep Path | sed s/Path=//. Default profile name is stored in profiles.ini. If you have more than one Firefox profile insert head -1 into the pipe between grep and sed as your default profile should be the first one under [Profile0] section.

share|improve this answer

Your default profile directory is stored under home directory.

cd ~/.mozilla/firefox 

Here you will find something like xxxxxxxx.default. This is the location where all your personal data is stored.

You can run the command firefox -P to show the profiles available and select one from the list.

share|improve this answer
    
The correct dir should be .mozilla –  Arch user Jan 10 '13 at 13:39
1  
That's what I'm doing right now, find $HOMEDIR/.mozilla/firefox/ -maxdepth 1 -type d -name *.default | head -1. But that CAN fail. It's not a good way to do it. –  Jorge Suárez de Lis Jan 10 '13 at 16:33
    
@palacsint: Thanks to you for the idea. :) –  whtyger Oct 8 '13 at 8:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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