Kill a process

I have done ps-ef  and found a particular process I need to kill.

gsmprodn 16476  9527  0 14:57:06 pts/1     0:00 grep

How do I know which is the parent PID and which is the child, and which one should I kill?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

in your above example you didn't find any process except for your own 'grep'.
Rather use ps -ef | grep | grep -v grep
The number in the second column (the one following the userid) is the process id. The number in the following, third column is the parent process id.
Which one to kill depends on what you're trying to achieve. Normally one would kill the actual process and not the parent!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stummjAuthor Commented:
LOL - thats annoying. I cant see the process then!
And I know its running as there are files being produced. I guess its the processes inside the wrapper I need to look for
stummjAuthor Commented:
Yes - that has sorted it
Kerem ERSOYPresidentCommented:
In the PS -ef output the seconnd column is the pid (process ID) and third column is ppid (parent process ID). You can see the headers too with this command:

ps -aef | egrep -E "^U|" | grep -v grep

Will show you columns with the heading.

If you want to do a kill then you would use the command:

ps -aef | grep | grep -v grep | xargs kill -9 $(awk '{ print $3 }')

to kill tehe parent while

ps -aef | grep | grep -v grep | xargs kill -9 $(awk '{ print $2 }')

Will kill the process (in this case

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.