12

When I type firefox in terminal, it starts Firefox but the terminal "hangs".

What is happening behind the scenes?

Can I open Firefox from terminal and keep on using the same terminal tab for other things without closing Firefox?

4
  • 2
    You would have found the solution yourself if you had done a bit of searching. Just put & after the command and it will run on background. Commented Dec 3, 2013 at 10:53
  • What is happening if I don't put &. How would you start firefox from the terminal if you had to and why? Commented Dec 3, 2013 at 13:32
  • 2
    Well, then the terminal will just hang as you noticed. Commented Dec 3, 2013 at 14:02
  • upvote for honest, no nonsense answer Commented Dec 3, 2013 at 14:36

4 Answers 4

12

The terminal locks when you are running an application from it as long as the application is running. With the ampersand (&) you can start the application in the background and still use the terminal. Type:

user@host:~# firefox &

To start firefox in the background. Output of the application will still be in the terminal.

Or, if firefox is already running you can do this:

  1. Ctrl+z to put firefox into the backgroound.
  2. Type:

    jobs
    

    You should see your jobs like :

    [1]+  Stopped  firefox.
    
  3. Type:

    bg %1 
    

    (or number of your job)

3
  • Are you running firefox as root? Commented Dec 16, 2015 at 9:24
  • @MattBianco No, why? Commented Dec 16, 2015 at 9:25
  • Traditionally, prompts ending with # indicate elevated privileges. (I didn't think you did, btw) Commented Dec 16, 2015 at 9:26
7

Use nohup firefox & to run firefox from terminal and you can use terminal for other process, if you close terminal, firefox will not quit.

If you get error like Another instance is running then use nohup firefox -P --no-remote & and create a new user profile and browse.

2

You can use the & symbol after your command to run it in background.

1

Use this command to run firefox in background as well you can exit the terminal but still the firefox will run.

hussain-->~#nohup firefox &

When you simply open the firefox then it will not return the prompt after closing the firefox only it will return the prompt.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.