I am using the following command to kill one java process via shell script:
pidof java|xargs kill -9 $1
What if the list of pidof output has more than one elements? How do I kill them both with the same one command?
|
I am using the following command to kill one java process via shell script:
What if the list of |
|||
|
|
|
First of all, check out
You can even use the full command with arguments as part of the search
Secondly, your construct with |
|||||
|
|
The |
||||
|
|
For example:
will give you the list of PIDs related to java. So you can use:
|
||||
|
|