Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get pid of specific application instance

Tags:

bash

conky

Lets say I want to kill just the conky instance with the configuration file conkyrc_update and not the other one workload. Is there a way to get the pid of a specific application instance?

[sebastian@archlinux-work ~]$ ps aux | grep conky
sebasti+  4277  1.0  0.1 102724 11408 ?        S    15:02   0:02 conky -c /home/sebastian/scripts/conky_sysmon/conkyrc_update
sebasti+  4278  0.0  0.1 250136  9720 ?        Sl   15:02   0:00 conky -c /home/sebastian/scripts/conky_sysmon/conkyrc_workload
like image 910
dollseb Avatar asked Nov 06 '25 07:11

dollseb


1 Answers

You can use pgrep with --full parameter (to match against the arguments too, and not only the process name):

pgrep --full conkyrc_update

and if you want to simply kill it, you can just:

pkill --full conkyrc_update
like image 138
Maximiliano Padulo Avatar answered Nov 09 '25 08:11

Maximiliano Padulo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!