Linux pkill command


pkill is a command used to kill a process if you know the process name or part of it.


pkill <ProcessName>


To kill firefox process with pkill use following command:

$ pkill firefox

Issue with pkill:

As mentioned pkill will kill a processes by matching name or part of name.

Lets see with example.

There are 2 processes are running with name firefox in my desktop

$ ps x | grep firefox


2277 ? Sl 76:16 /usr/lib/firefox/firefox
5866 ? Sl 42:50 /usr/lib/firefox/plugin-container /usr/lib/flashplugin-installer/ -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 2277 false plugin

Now if we run pkill firfox, it will kill all processes with name firefox or part of name firefox.

After running pkill command, there wont be any process running with name firefox.


Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s