Link to home
Start Free TrialLog in
Avatar of jxbma
jxbmaFlag for United States of America

asked on

How do I kill process in UNIX using sudo and pgrep?

Hi:

I'm pretty new to the world of UNIX.
I'm a windows guy new to all of this.

I'm trying to identify and kill processes on my box.

sudo pgrep -f cassandra
----------------------------------
<returns the associated process IDs (good)>
14215
28140


So, to kill all the "cassandra" processes on the system:
--------------------------------------------------------------------------
sudo grep -f cassandra | xargs kill -9


I get the following results:
-----------------------------------
kill 14166: No such process
kill 28140: Operation not permitted


What am I doing wrong here?

Thanks,
JB
ASKER CERTIFIED SOLUTION
Avatar of Kerem ERSOY
Kerem ERSOY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jxbma

ASKER

Thanks folks!
Both pieces of info were useful in explaining what's going on.