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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s