Solved

To Kill Processes

Posted on 2014-11-13
3
213 Views
Last Modified: 2014-11-13
I want to kill all processes in this list with oracleBB60
oracle    7282     1  0 07:44 ?        00:00:00 ora_arcp_BB60
oracle    7284     1  0 07:44 ?        00:00:00 ora_arcq_BB60
oracle    7286     1  0 07:44 ?        00:00:00 ora_arcr_BB60
oracle    7288     1  0 07:44 ?        00:00:00 ora_arcs_BB60
oracle    7292     1  0 07:44 ?        00:00:00 ora_arct_BB60
oracle    8174     1  0 10:25 ?        00:00:00 oracleBB60 (LOCAL=NO)
oracle    8176     1  0 10:25 ?        00:00:00 oracleBB60 (LOCAL=NO)
oracle    8178     1  0 10:25 ?        00:00:19 oracleBB60 (LOCAL=NO)
oracle    8180     1  0 10:26 ?        00:00:00 oracleBB60 (LOCAL=NO)
oracle    9351     1  0 13:31 ?        00:00:00 ora_mrp0_BB60
oracle    9353     1  0 13:31 ?        00:00:02 ora_pr00_BB60
oracle    9357     1  0 13:31 ?        00:00:12 ora_pr01_BB60

Getting command not found when I run
-bash-3.2$  ps -ef|grep "oracleBB60"|grep -v grep|awk '{ print $2 }'| -exec kill  –f {} \;
-bash: -exec: command not found

What am I missing?
0
Comment
Question by:xoxomos
3 Comments
 
LVL 13

Accepted Solution

by:
Alexander Eßer [Alex140181] earned 350 total points
ID: 40441451
for KILLPID in `ps ax | grep 'my_pattern' | awk ' { print $1;}'`; do 
  kill -9 $KILLPID;
done

Open in new window


or

ps -ef | grep PROCESS | grep -v grep | awk '{print $2}' | xargs kill -9

Open in new window


or use PKILL
0
 
LVL 37

Assisted Solution

by:Gerwin Jansen
Gerwin Jansen earned 150 total points
ID: 40441529
This will give you a list of process id's
ps -ef|grep "oracleBB60"|grep -v grep|awk '{ print $2 }'

Open in new window


To kill these processes, just give the output of the above (a list) to the kill command:
kill -9 $(ps -ef|grep "oracleBB60"|grep -v grep|awk '{ print $2 }')

Open in new window

0
 

Author Closing Comment

by:xoxomos
ID: 40441613
SEXY :-)  Thanks.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now