A Guide to Kill, Pkill and Killall Commands to Terminate a Process in Linux

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Avishek Kumar

I am a major in computer science, love to research nix. I love to write codes and scripts, review distros, experiment Foss Technologies, write technical articles, Hack, of course Ethically. I am working as System Administrator (nix) for a NGO.

Your name can also be listed here. Work as a Paid freelancer/writer at TecMint.

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

18 Responses

  1. Cesar says:

    I have problems with chrome slowing down my system, so I’m used to kill all stances of chrome with this command:

    $ while [pidof chrome]; do killall chrome; done

  2. Sriram says:

    Hi,

    Can you please tell how to kill all the process running when i close the terminal/screen. Thanks.

    • Avishek Kumar says:

      Dear sriram,
      i Didn’t get you question.
      When you close a terminal. All the running processes gets killed except those running in background and you can kill those by finding their pid.

  3. tamal2015 says:

    hi…can u tell me the procedure to replace graphic card in red hat linux enterprise 6.0?…my pc was shipped with nvidia 610GT(zotac made GT610) but i need to replace it with nvidia 210GT(asus made En210). the second card is downgraded than the first one.Also can u inform me whether I need to do free OS install or not for this? ur kindness is appreciated on this!!!

    • Avishek Kumar says:

      I fear it would be built on the board and perhaps u cant swap it. Ask your Vendor for such detailed hardware information.

  4. linux fresher says:

    may god bless this website to me more powerful than RHKB. Please list out INterview section for new admins.

    • Avishek Kumar says:

      @ Linux Fresher, I didn’t get you properly, although as far as i could understand, you said words for Appraisals for us. Thanks

  5. Also xkill is the easiest way to kill a process using just your mouse.

    Just type ‘xkill’ in the terminal and then it would change the cursor to a cross, then just click on the process you want to kill and you are done. It is as easy as that.

    Please add this also. This is very useful in some really frustrating situations like stuck in the middle of a game, then just do Alt+Ctrl+T to bring up the terminal and kill the game using xkill.

    It has helped me quite a lot of times, it might help you also.

  6. ubungu says:

    Thank techmint for valuable posts :)

    Thank again for good tip :)

  7. akane says:

    DO NOT use kill to stop services as a first resort. This will mess up your system if you do it regularly. Use the init scripts already set up for that purpose, or whichever program is provided for control of the service.

    Normally, for example to stop rsyncd, you should use “/etc/init.d/rsync stop”. You can use the same script to start, restart, or get status of the service. Read the script to learn more about what it does.

    If you have Upstart installed, then the “service” command works similarly (but arguably better). The syntax is “service rsync restart” to restart rsyncd, for example. Currently Upstart does not support all services in Debian-based distros, so you might need to use the previous method.

    Many services come with their own maintenance programs separate from the init.d scripts. For example, apache2 httpd comes with apachectl.

    Finally, while the “kill” command is mostly used to stop processes, it can send *any* signal. Check out the manpage for more information. kill is much more useful than explained here- but also more dangerous.

    • Pawel says:

      Killall on Solaris will kill all processes on the system making it unusable.
      so it’s not a good habit to use killall. So use it with extreme care first check then use :-)

  8. siddiqullah says:

    i usually see interesting topics of linux in this site.i realy like this site ,because it gets me femiliar with linux and i have leant alot upto know.

    thanks

  9. Suvarna says:

    Really very helpful information. I will try to use this to decrease server load. Thank You Tecmint for sharing all valuable posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Join Over 62000+ Linux Users
  1. 46679
  2. 2055
  3. 10101

Enter your email to get latest Linux Howto's