How to Restart Firefox from the Command Line

Users of Linux are more than likely used to seeing Firefox installed on their systems by default, and they might very well type the name of the program in a terminal to start it. The name of the browser in all lower case is enough to start it up, but some users might want to restart it while preserving their current session.

You’ll potentially need to make a change in the Preferences tab if you’d like to do this, but otherwise it’s extremely easy. Mozilla Firefox users might not be aware of the fact that they can also restart their browser from an internal command line that’s unrelated to the general bash shell most Linux users are familiar with.

Method 1: Restart Firefox from the Command Line

You’ll need to have a graphical Linux terminal open to work on this. Search for terminal on the Ubuntu Unity Dash line to start one if you’re using pure Ubuntu. KDE users and those using Cinnamon or MATE, such as in Linux Mint, can click on the Applications menu and then click on Terminal from the System menu. Xfce4 and LXDE users should have a similar experience. Nearly everyone can hold down Ctrl, Alt and T to open a window regardless of desktop environment.

At the command prompt, type killall firefox and push enter to kill all running instances of the Mozilla Firefox browser. Keep in mind that this will close out running browsers without prompting them to approve it, which might surprise users who’ve never tried it before!

Type firefox and push enter to restart the Firefox browser and keep the terminal window active. You can usually safely close the terminal window after you’ve done this. You generally won’t have to add an ampersand to keep the bash shell active, since modern Firefox implementations start from a script. These two commands are all you’ll usually ever need.

Method 2: Reloading Tabs When You Restart Firefox

In most cases, any tabs you had opened before you issued the commands will reload in the new session. However, if you find that Firefox didn’t reload them, then you can select the History menu and select Restore Previous Session. If you find that it’s not consistently loading the tabs, then you can either select the Edit menu and click on Preferences or type about:preferences in the URL line and push enter.

There’s a line that reads When Firefox starts: followed by what behavior the user expects when starting the browser. It’s set to “Show your home page” by default, but you can click on it and change it to “Show your windows and tabs from last time” to ensure that they always come back up. Of course, you can change this behavior however often you’d like by returning to this screen.

Method 3: Restart Firefox from the GCLI

When you’re running Firefox, hold down Shift and push F2 to open up the Graphical Command Line Interface or GCLI. It’s an internal command line that Firefox offers to power user. Type restart and push enter at this prompt to restart Firefox instantly.

This command also accepts a few command line arguments for when you want to restart Firefox in special troubleshooting modes. Typing restart –safemode will restart Firefox in Safe Mode and even give you a special troubleshooting dialog box. Don’t click on the Refresh option if prompted unless you absolutely want to preform a Firefox refresh operation. You can always close the dialog box and then restart Firefox from the Applications menu or from the command line if you want to cancel a safe mode restart without making any real changes at all.

If you’re afraid that you had some cache loading issues in the past, then typing restart –nocache will prevent the cache content from loading when you restart Firefox. This doesn’t actually clear the cache per say the way you might if you were cleaning out browser history, but rather leaves it in place and loads without it.

You’ll hopefully never need to make use of either of these options, and neither of them should be used loosely. Generally, you’ll only ever want to use restart with no other commands after it.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.