killing 300 process at the same time


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers killing 300 process at the same time
# 1  
Old 07-20-2009
killing 300 process at the same time

Here's the scenario

i have this servd process i want to kill, but i want to kill it one time.

Code:
bash-2.03# ps -ef | grep servd | grep User123 | wc -l
    300

bash-2.03# ps -ef | grep servd | grep User123 | more

 User123  2007  2006  0 03:17:09 pts/12   0:00 /usr/bin/su - User123 -c ssh localhost /files0/bin/servd 
 User123  2432  2429  0 03:25:50 pts/12   0:00 /usr/bin/su - User123 -c ssh localhost /files0/bin/servd 
 User123  2126  2125  0 03:18:24 pts/12   0:00 /usr/bin/su - User123 -c ssh localhost /files0/bin/servd

tried the killall command and it doesn't work. ( or maybe i missed something)

Anyone who can help me. TIA
# 2  
Old 07-20-2009
Code:
kill -9 `ps -ef |grep servd | grep user123 | awk '{ print $2 }'`


Last edited by Yogesh Sawant; 07-20-2009 at 07:34 AM.. Reason: added code tags
# 3  
Old 07-20-2009
Bug

Quote:
Originally Posted by sparcguy
kill -9 `ps -ef |grep servd | grep user123 | awk '{ print $2 }'`

Thank you very much. It works!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Killing the process if running for long time in script

I am running a script which will read the data from fail line by line and call the Java program by providing the arguments from the each line. The Java code is working fast for few records and for some records its getting hanged not providing response for morethan one hour. Currently am... (4 Replies)
Discussion started by: dineshaila
4 Replies

2. Shell Programming and Scripting

Killing the process ID's

Hi , I have a list of application process id's. Is there a way to kill all the process listed below using the script, except the once which are starting with " Genesis " adm 1522 ABC_Process.tra adm 1939 Genesis_Process.tra adm 2729 Genesis_Archive.tra adm 3259 xyz_Process.tra (5 Replies)
Discussion started by: murali1687
5 Replies

3. UNIX Desktop Questions & Answers

Automatically killing a process if it doesn't use any CPU time

Hi, I'm new to Linux. I have a windows server that run many processes on it. In some cases the processes doesn't exit properly or just stop working and the process needs to be killed. I was wondering how i can automatically (couple of times a day) check which process doesn't use any CPU... (3 Replies)
Discussion started by: ramikom
3 Replies

4. UNIX Desktop Questions & Answers

Killing a process if it is not using any cpu time

Hi i am a newbie thanks in advance i have a process which keeps on running but doesn't use any CPU time and doesn't do the functionality which it is suppose to do . If i kill the process and start the process again then the process kicks in and starts using CPU time and continues to do its... (3 Replies)
Discussion started by: nick1982
3 Replies

5. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

6. Shell Programming and Scripting

Killing process!!!!

Hi friends, i m in big trouble.... i have one script which connects two server ...like below.. script1.sh ------------------------------------- bash test.sh & eval x=$@ export x=`echo $x` #echo $x # ssh user@8.2.5.6 bash /mbbv/location/script.sh $x|sed '/Binary file/d'... (1 Reply)
Discussion started by: Shahul
1 Replies

7. UNIX for Dummies Questions & Answers

killing the process

Hi, First, I am running a scipt.While the script is running I realize that I dont want the script to be run so I am killing the script externally.Before the process gets terminated or killed it should delete all the temporary files created by the script.How to do this?Can anyone help me? ... (3 Replies)
Discussion started by: arthi
3 Replies

8. Shell Programming and Scripting

Killing of a process and send a mail if the process doesnot come up within 2 minutes

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument . There is a... (1 Reply)
Discussion started by: Prince89
1 Replies

9. UNIX for Dummies Questions & Answers

killing a process

I can kill running processes on my linux red hat system using ctrl-c but cannot do it from command line of another terminal using kill -2 pid. Although I can kill them from command line using kill -9 pid and other signals. I would like to do it using the kill -2 pid. Thanks for your suggestions (6 Replies)
Discussion started by: bbhayana
6 Replies
Login or Register to Ask a Question