3
1
I have a process with the name bla
, and I want to kill it by its name.
When I run ps aux | grep "bla"
, I get 2 entries:
- process
bla
and blablablab
How do I filter it out?
3
1
I have a process with the name bla
, and I want to kill it by its name.
When I run ps aux | grep "bla"
, I get 2 entries:
bla
andblablablab
How do I filter it out?
12
killall bla
to force it:
killall -9 bla
5
Take a look at pkill, if available.
1+1. man pkill also mentions the pgrep. The tools are part of the same package as top and ps and should be available on pretty much all Linux systems. (Solaris has them too). killall and pidof are not so portable. – Dummy00001 – 2010-06-29T10:47:58.817
pkill is the most flexible by far. Kills by user, parent process, terminal… – Tobu – 2010-06-29T10:57:52.133
0
You can use the PID of the process to kill it.
Check out man pages for command kill.
The exact option would be kill -9 <pid>
Do you shut down your computer by holding the power button for X amount of seconds also? Because kill -9 is equally stupid. Please read http://speculation.org/garrick/kill-9.html
– None – 2010-06-29T09:51:14.773this way you are killing the process by his pid but by this name. – TheHippo – 2010-06-29T09:55:45.757
0
While the killing question has been well answered, you asked how can you avoid getting the process "blabla" when you wanted "bla". What you want to do is add -w:
ps aux | grep -w "bla"
This does not kill it by its name. – superuser0 – 2013-04-08T19:10:35.470
Not intended to kill, I just noticed no one had answered his other question, namely how to find "bla" without finding "blabla". – Philip Kearns – 2013-04-08T22:28:30.177
Please be more specific and provide the example or the actual terminal scrrenshot. – None – 2010-06-29T09:51:38.097