How to kill all processes with the same name?
6,262
You can use the pkill command.
pkill -u user_1 myapp
Note that myapp2
won't be killed as it has a different name.
Related videos on Youtube
Author by
Omar Malas
Updated on September 18, 2022Comments
-
Omar Malas over 1 year
I want to kill all processes with the same name that belong to a user, for example:
$ps -u user_1 2345 myapp 2346 myapp 2347 myapp 2348 myapp2 2349 myapp
I want to kill all "myapp" processes that belong to "user_1", how can I do this?
-
cpast over 11 yearsTo kill all processes, use
killall
. I'm not kidding:man killall
. -
dinesh over 11 yearsHere's a link to a discussion on askubuntu that might answer your question.
-
-
Arpit over 11 yearsand @cpast is right. killall will do the same.
-
rbaleksandar about 6 years@Aprit I don'T believe that
killall
supports wildcards, which forces you to be very precise when passing the name of the process you would like to terminate.