I want to use pgrep
to find the pid of a process, e.g.
$ pgrep bluetoothd
441
However, the processes I need to search run within a wrapper called RunFIDProcess
:
[cama@dc1-dev-lin-1204 tests]$ ps -ef | grep RunFIDProcess
tps 544 1 0 Dec13 ? 00:00:00 /bin/sh .//RunFIDProcess CASE_SJDI SJdi -c SJdi.auto.cfg -m PRIMARY_WARM
tps 546 1 0 Dec13 ? 00:00:00 /bin/sh .//RunFIDProcess CASE_ETH Eth -c Eth.cfg
tps 547 1 0 Dec13 ? 00:00:00 /bin/sh .//RunFIDProcess CASE_DBWEBSERVER DbWebServer
tps 556 1 0 Dec13 ? 00:00:00 /bin/sh .//RunFIDProcess CASE_TABLE_PROXY TableProxy -c TableProxy.cfg
cama 4519 1 0 07:30 ? 00:00:00 /bin/sh .//RunFIDProcess CASE_SJDI SJdi -c SJdi.auto.cfg -m PRIMARY_WARM
cama 4524 1 0 07:30 ? 00:00:00 /bin/sh .//RunFIDProcess CAMA_DS5_QRY DaqSvr -m cold -c cama_DaqSvr.DS5.cfg
cama 4530 1 0 07:30 ? 00:00:00 /bin/sh .//RunFIDProcess CAMA_US_OSUB Osub -c cama_Osub.US.auto.cfg -Cold
cama 4534 1 0 07:30 ? 00:00:00 /bin/sh .//RunFIDProcess CAMA_DS7_QRY DaqSvr -m cold -c cama_DaqSvr.DS7.cfg
So,
[cama@dc1-dev-lin-1204 tests]$ pgrep CAMA_US_OSUB
returns nothing.
How can I find a process by its name as well as its first command line argument?
pgrep -f CAMA_US_0SUB