View Full Version : how to Detect Running Firefox through shell script?

January 28th, 2008, 07:08 AM
I want to Detect Through Shell Script that whether firefox browser is running or not? How can i do this?

Thanks in advance

January 28th, 2008, 07:12 AM
check for its process

ps -ef |grep firefox


pgrep firefox

January 28th, 2008, 07:15 AM
To see all the processes running, just type this in:

ps -A

Then you scroll through the list and look for firefox.

Sometimes when you run a program it will start more than one process related to that program.

To stop all the processes related to a program you type killall like this (let's use firefox for an example:

killall firefox

If you are getting an error message saying firefox is already running, then you either need to delete the .parentlock file in the profile directory, or you no longer have write permission to the profile directory.