Solved

Linux, pkill

Posted on 2013-05-24
4
545 Views
Last Modified: 2013-05-24
If I issue the following command

   pkill java

Will that kill all the java processes I have running, or just one

Will it kill anothy other than a java process ?

Thanks
0
Comment
Question by:Los Angeles1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 30

Accepted Solution

by:
serialband earned 125 total points
ID: 39195761
It should kill all of processes that match the pattern java.

So if you have a processes name java, javac, and newjava, they will all be killed.
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 125 total points
ID: 39195768
All process contains the word "java".

Try tighten down process name -

pkill xxxxjavaxxxx

Open in new window

0
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 125 total points
ID: 39195803
It will kill All processes with a name "java" . But I doubt this is what you want. Will you please explain what is that you want to achieve?

I suggest you to run the command as
pkill -9 java

Open in new window



To make sure that the kill request was not masked.
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 125 total points
ID: 39195936
As the man page says:


"pattern
    Specifies an Extended Regular Expression for matching against the process names or command lines."

This means that it will match with process name or command line.

Also quoting from links below:

"Pkill Example:

Before sending signal, you can verify which are all the process is matching the criteria using “pgrep -l”, which displays the process ID and process name of the matching processes."


Normal users may kill their processes only. root can kill others processes as well.

Please see links below

http://unix.stackexchange.com/questions/23930/how-to-pkill-by-command-name
http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/
http://www.linuxintheshell.org/2012/12/18/episode-20-pgrep-and-pkill/
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

623 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