killing processes thru' C programs

Dan Gill dan at systech.bjorn.COM
Tue Apr 30 14:00:27 AEST 1991


> 	ps ux | awk '/name/ && !/awk/ {print $2}'
> 
> You replace "name" with the name of the process for which you are
> searching.
> 
> them, and print the PID's for those lines.  Note that the "!/awk/"
> above prevents the awk process for being listed.

if you use ps uxc | grep name | awk '{print $2}' the only thing displayed
is the pid of the processes name.  You should be careful for if you used
vi as the name, there could be some unhappy campers in your KOA.

Dg
-- 
-------------------------------------------------------------------------------
"On second thought, let us not go to Camelot.  It is a silly place"
Dan Gill                              [uunet ucsd.edu]!systech!dan
-------------------------------------------------------------------------------



More information about the Comp.unix.questions mailing list