Skip to main content
6 events
when toggle format what by license comment
Jul 9, 2021 at 16:25 comment added Marc Compere pkill -f -SIGKILL pattern fails miserably. it even reports Killed when pattern is a running process or not even a running process. what?!?! the other methods, like this answer, works. something is not right with pkill
Oct 30, 2020 at 22:03 comment added ibilgen I tried "pkill -f -SIGKILL pattern" but didn't kill my processes but "kill -9 $(pgrep -f somepattern)" killed all of them.
Sep 24, 2020 at 22:45 comment added Kusalananda You will notice that pkill also has the -f option which makes it match the pattern against the full command line, just like pgrep -f does. The difference being that pkill also sends a signal to the matching processes. With pkill -f -SIGKILL pattern you therefore send the KILL signal to any process whose command line matches pattern.
Sep 24, 2020 at 20:56 comment added ibilgen pkill just sends sigterm and in my case, it did not kill any of my processes. pkill -SIGKILL also did not work. pgrep -f returns the pid of matching processes and as I stated, this worked perfectly while the others did not.
Sep 24, 2020 at 18:06 comment added Kusalananda Is there a reason why you wouldn't use pkill -f to kill the matching processes, and why you rather introduce a race condition by first calling pgrep -f and then kill?
Sep 24, 2020 at 17:57 history answered ibilgen CC BY-SA 4.0