Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again. Thanks!

  1. Get $5 off your first Lyft ride while helping us pay for hosting Linux.org! --> $5 Lyft
    Dismiss Notice

How to kill a proccess?

Discussion in 'Command Line' started by carbon333, Feb 16, 2012.

  1. carbon333

    carbon333 Guest

    You can do this by typing:

    killall name

    in the terminal. 'name' is the name of the procces to be killed.
  2. sbircris.jr

    sbircris.jr Guest

    Or you can use # kill -9 process ID
    -9 is special kill signal, which will kill the process (Linux command, not UNX)
  3. enhu

    enhu Guest

    identify the process id by issuing #top command
    and then # kill -9 [processID]

    This is how i do it when mu computer hangs due to openshot. I just move to the terminal and then kill some running programs.
  4. Akendo

    Akendo Guest

    That's wrong. killall/kill will send a TERM signal to the program. This will ask the program to close itself. Kill is more a "signal singer", who is sending system signals to the programs. To "kill" a program you have to use the -9 option what is the real killer.

    You can use kill also to get a status of a program. For example dd. It will not print any status or progress till it's done. With kill -USR2 $DDPID you get a status out.

    HowTos are nice, but only when you explain what is happing. Details like this are important.

    so far
    2 people like this.
  5. goodselfme

    goodselfme Guest

    I will work this while I have this window open to follow these instructions well.thank you.
  6. carbon333

    carbon333 Guest

    But why even use "kill" instead of "killall" if you don't know the ID? Why check it first? killall was written so you don't have to to this!
  7. Akendo

    Akendo Guest

    pkill works with the name, like killall. But you should recognize the problem with killall/pkill. It's a system wide killer, this is a problem on multi-user system. When other users use the same tool/program and your killing it that way away.

    so far
  8. EddyInBlu

    EddyInBlu Guest

    Let's say you gotta kill the apache daemon?

    This is what I do

    ps aux | grep apache | cut -d ' ' -f 1 | xargs kill -9

    That'll do it

    Right?? XD
  9. KenJackson

    KenJackson Guest

    How about these:
    service httpd stop
    systemctl stop httpd.service
    rc.d stop httpd
    BTW, -9 is the same as -KILL. I had to run the command kill -l to find out what 9 is.
  10. Akendo

    Akendo Guest

    That's nice, but your about to lose a bit of the topic. Sure KenJackson, that is a "way" of doing it. But that's confusing, what system do you running on?
  11. KenJackson

    KenJackson Guest

    The first one was the old way on Fedora (and I think Red Hat and CentOS, and probably PCLinuxOS and others), and it still works.

    The second one is the new way on those same systems, and probably on more.

    The third one is Arch (at least it should be right--I don't actually run an apache server on Arch).

    The point is that there is a more correct way to shutdown a server. Killing is always a last resort--even on a computer.
  12. lanlanlangzi

    lanlanlangzi Guest

    first ps,then kill /killall command
  13. I think killing a process should be quite similar to how it is done on Windows. Whatever opens up your Task Manager should include Processes, in which you can easily disable a process if needed.
  14. grim76

    grim76 Guest

    Not everything is running a gui. I know the two servers that I run at home don't even have a gui installed.
  15. Renzaku

    Renzaku Guest

    This really is the only thing that I have to post. It's old, but it totally relates to this!

    Click Here
  16. Acronix

    Acronix Guest

    Check the process list first by issuing the following command:

    $ ps x
    Then look for the process identifier (PID) of the program you want to kill, then type:

    $ kill -9 [PID]
    That's what they taught me ever since and that's what I always use.
    The -9 will ensure "execution" of your command.
  17. Godric

    Godric Guest

    Very helpful. Thanks. I suppose this is the dos version of windows?
  18. Acronix

    Acronix Guest

    No, it's for Linux terminal. You're welcome.
  19. Step #1: First, you need to find out process PID (process id),Use ps command or pidof command to find out process ID (PID). Syntax ps aux | grep processname pidof processname. Step #2Above command tell you PID of lighttpd process. Now kill process using this PID.
  20. DaReaper

    DaReaper Guest

    I usually search for the process and it's PID before i attempt to kill or terminate it. Well i use grep to see if the process is running

    ps aux | grep kloxo
    then find it's process id

    pidof kloxo
    and kill it using

    kill pid

Share This Page