what is the command to restart firefox from the command line?

36,055

Solution 1

First kill all processes that is named Firefox which means killing the existing running firefox then run it again

pkill firefox
firefox &

Solution 2

At least in my version, Firefox doesn't have a restart option. You can kill the process and then start it again. For example:

killall firefox
firefox

If killall doesn't cut it, you can use pkill instead. Just keep in mind that pkill would kill any process with firefox in its name, though probably that's not a big concern.

Solution 3

Update

In the address bar write

  1. about:profiles
    then press the Tab button a couple of times to select the Restart Normally or the Restart with Add-ons Disabled button on the loaded page, and finally press Enter.

  2. about:restartrequired then press Enter (it should be already selected else you can always press Tab).


Under Linux it is possible to use from command line

pkill -f firefox && firefox 2>/dev/null &

killing all the processes with word firefox in the whole (full) command line, redirecting the error log to /dev/null; maybe after checking with pgrep -fl firefox.


It's a command line but an internal one...

Press ShiftF2, write restart in the opened bar (at the very bottom), then press enter.

On old versions, e.g. the 41.0.2, it was needed to write the word true too: restart true.

Some words more

It's possible to force firefox to restart through the Developer Toolbar, usually accessible via ShiftF2 or via menu (Firefox/Tools >> Web Developer >> Developer Toolbar in the English version).

A bar will be opened in the bottom of the page where it will be possible to write the command

restart

It is possible to use restart --nocache true or restart --nocache false in order to force it the refresh of the tabs content or to use the local cached instead. It can result useful the --safemode option too.

You can find some words more and the old synopsis on another answer of mine on SuperUser.

Solution 4

The below would be better since using nohup is cleaner and forcing firefox to stop wit -9 is sometimes important

pkill -9 firefox
nohup firefox &
Share:
36,055
sriraj
Author by

sriraj

Updated on September 18, 2022

Comments

  • sriraj
    sriraj almost 2 years

    how to restart firefox from the command-line. I have already given as "firefox". Is this the right command to restart the firefox?

  • Maythux
    Maythux over 10 years
    @sriraj you are welcome but if you find this help you it's better to mark as answer and upvote
  • Kasun Siyambalapitiya
    Kasun Siyambalapitiya almost 8 years
    what is the difference inkillall and pkill?
  • Kasun Siyambalapitiya
    Kasun Siyambalapitiya almost 8 years
    what is the meaning -9 in the pkill command
  • kamil
    kamil almost 8 years
    it forces killing the process
  • SuB
    SuB over 7 years
    Just a note: This solution does not work when you want to restart Firefox from a non-GUI shell (such as SSH connection).
  • j.c
    j.c over 2 years
    In Firefox 93.0 the shortkey is <Alt>+F2, and the "restart" command will restart only the current Firefox instance
  • Hastur
    Hastur over 2 years
    @j.c Updated with a couple of methods you can use instead. From version 62 (in September 2018) there is no more Developer Toolbar, there is a Console under the Web Developer Tools (Ctrl+Shift+I), but no more restart command (at least under Linux )... It is needed to use one of the two methods above.