As the title suggests, the following command on Ubuntu 20.04:
pgrep firefox
... returns no results.
Meanwhile, the following command:
ps aux |grep firefox
... returns 6 results, 5 of which should match pgrep firefox
. What's wrong with the original pgrep
command on Ubuntu?
ubuntu 81646 1.9 7.9 3063696 300208 ? Sl 13:12 0:29 /usr/lib/firefox/firefox -new-window
ubuntu 81891 0.2 3.8 2473448 144796 ? Sl 13:12 0:03 /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 222536 -parentBuildID 20200720193547 -appdir /usr/lib/firefox/browser 81646 true tab
ubuntu 82020 0.1 3.7 2438972 141396 ? Sl 13:12 0:02 /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 897 -prefMapSize 222536 -parentBuildID 20200720193547 -appdir /usr/lib/firefox/browser 81646 true tab
ubuntu 82051 0.0 2.8 2401248 107520 ? Sl 13:12 0:01 /usr/lib/firefox/firefox -contentproc -childID 4 -isForBrowser -prefsLen 6935 -prefMapSize 222536 -parentBuildID 20200720193547 -appdir /usr/lib/firefox/browser 81646 true tab
ubuntu 83658 0.0 2.0 2387704 78496 ? Sl 13:12 0:00 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 10362 -prefMapSize 222536 -parentBuildID 20200720193547 -appdir /usr/lib/firefox/browser 81646 true tab
ubuntu 90700 0.0 0.0 17664 664 pts/0 S+ 13:37 0:00 grep --color=auto firefox
Running the same command on Ubuntu 18.04 and macOS works just fine.
pgrep -f firefox
works? Are the versions of firefox the same in both Ubuntus? I suspect you'll find that it's not "pgrep
on Ubuntu" that's responsible - it's Firefox, for apparently writingMainThread
orWeb Content
or somesuch instead offirefox
to/proc/<pid>/comm
...pgrep -f firefox
works but it also returns false-positives for e.g. a process started asgedit ~/Desktop/firefox.txt
. What's a good way to see exactly what's writing in/proc/<pid>
so that I can search for that as an interim?cat /proc/81646/comm
returnsMainThread
as suspected. Checking 18.04.firefox
, notMainThread
as predicted.