A process is running for 1000 times.How to kill all processes except one i.e kill 999 processes?
Answer Posted / lokesh210
I think it will work.
U can kill all the process except one as below,
set a=`ps -ef|grep -c "XYZ"`
ps -ef|grep "XYZ"|head -`expr $a - 1`|xargs kill -9
To kill all the instances of that process
ps -ef|grep "XYZ"|xargs kill -9
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to find out what processes are running in the background in unix?
Is unix still relevant?
List the distributions of unix.
Explain the different types of pathnames that are used in unix.
Is mac terminal unix?
How does unix work?
What is .sh file in unix?
Who is founder of unix?
How do I find my unix os version?
What is unix directory structure?
What is unix shell scripting used for?
Explain system bootup in unix.
What is the procedure to configure MC/SG Cluster services in HP-UX 11i v3 OS Environment?
Why do we need unix shell scripting?
What is awk sed unix?