V
V
vk222018-12-26 19:21:58
linux
vk22, 2018-12-26 19:21:58

How to find out the PID of a specific process?

I have 2 times running one process from different config files.
root 25709 0.0 0.0 52928 3924 ? S 15:11 0:00 sudo ices -c /usr/local/etc/ices2.conf
root 25710 0.1 0.0 75124 5252 ? S 15:11 0:04 ices -c /usr/local/etc/ices2.conf
root 26028 0.0 0.0 52928 3980 ? S 15:42 0:00 sudo ices -c /usr/local/etc/ices.conf
root 26029 0.1 0.0 75368 5436 ? S 15:42 0:03 ices -c /usr/local/etc/ices.conf
user 26272 0.0 0.0 14224 972 pts/5 S+ 16:13 0:00 grep --color=auto ices
How do I get the PID of a particular process? If I do pidof ices, then I get:
26029 25710
And how to get one, specific process to kill it, for example. Is it possible?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2018-12-26
@alexr64

ps ex | grep ices | grep ices2.conf | grep -v grep | awk '{print $1}'

S
Saboteur, 2018-12-26
@saboteur_kiev

so what process do you want to kill?
You have two spinning.
Pick any one.
You can use the same pidof (man pidof)
pidof -s ices

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question