Linux – Kill a Process by Name

Update: Please read the comments or just use killall <appname>

If you know the command

ps -A

then tou will probable also know

ps -A | grep firefox

now you can manually kill this via

kill -9 <ID>

Where <ID> is from the last output. But how to do this in one line? If your ps command knows:

ps opid= -C firefox
(should print the <ID>)

Then you can simply do

kill -9 $(ps opid= -C firefox)


4 thoughts on “Linux – Kill a Process by Name

Comments are closed.