I am a new Linux system user. How do I kill a process on Linux based server using command line options? How can I kill running process on Unix?

Linux and Unix-like operating system come with the kill command to terminate stalled or unwanted processes without having to log out or restart the server.
Hence, it is important to the stability of Linux systems. The kill command sends the designated signal such as KILL process to the specified process or process groups. If no signal is specified, the TERM signal is sent. Please note that kill command can be internal as part of modern shells built-in function or externally located at /bin/kill. Usage and syntax remain similar regardless internal or external kill command.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements kill
Est. reading time 10 minutes

A list of common Linux or Unix TERM signals

Linux and Unix-like operating system support the standard terminate signals listed below:

  1. SIGHUP (1) – Hangup detected on controlling terminal or death of controlling process. Use SIGHUP to reload configuration files and open/close log files.
  2. SIGKILL (9) – Kill signal. Use SIGKILL as a last resort to kill process. It will not save data or cleaning kill the process.
  3. SIGTERM (15) – Termination signal. It is the default and safest way to kill process.

The kill and killall command support more than 60 signals. However, most users only need to use signal 9 or 15. To get a full list of signals, type:
kill -l
Kill Process in Linux or Unix using the kill command signals

What is a PID?

A Linux or Unix process is running instance of a program. For example, Firefox is a running process if you are browsing the Internet. Each time you start Firefox browser, the system is automatically assigned a unique process identification number (PID). A PID is automatically assigned to each process when it is created on the system. To find out PID of firefox or httpd process use the following pidof command:

pidof httpd
pidof apache2
pidof firefox

OR use the combination of ps command and grep command/egrep command:

ps aux | grep httpd
ps aux | grep apache2
ps aux | grep  firefox
Fig.01: Find the process ID (PID) of a running firefox program and apache2 server.

Fig.01: Find the process ID (PID) of a running firefox program and apache2 server.

pgrep command

You can use pgrep command to find process ID (PID) too:
pgrep process
pgrep firefox
pgrep vim

How to kill process in Linux from the command line

The syntax is:

kill -[signal] PID
kill -15 PID
kill -9 PID
kill [options] -SIGTERM PID

What Linux or Unix permissions do I need to kill a process?

Rules are simple:

  1. You can kill all your own process.
  2. Only root user can kill system level process.
  3. Only root user can kill process started by other users.

kill command examples to kill a process on Linux

In this example, I am going to kill lighttpd server process.

Step 1 – Find out the PID (process id) of the lighttpd

Use the ps or pidof command to find out PID for any program. For example, if process name is lighttpd, you can use any one of the following command to obtain process ID:
pidof lighttpd
Sample outputs:


ps aux | grep lighttpd
Sample outputs:

lighttpd  3486  0.0  0.1   4248  1432 ?        S    Jul31   0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
lighttpd  3492  0.0  0.5  13752  3936 ?        Ss   Jul31   0:00 /usr/bin/php5-cg

Step 2 – kill the process using a PID

The PID # 3486 is assigned to the lighttpd process. To kill the lighttpd server, you need to pass a PID as follows:
# kill 3486
$ sudo kill 3486
This will terminate a process with a PID of 3486.

Step 3 – How to verify that the process is gone/killed

Again use the ps command or pidof command or pgrep command as follows:
$ ps aux | grep lighttpd
$ pidof lighttpd
$ pgrep lighttpd

There should be no output or PID on your screen.

A note about sending stronger signal # 9 (SIGKILL)

If no signal specified in the kill command, signal # 15 (SIGTERM), is sent by default. So the kill 3486 command is same as the following command:
# kill -15 3486
# kill -SIGTERM 3486

$ sudo kill -15 3486
$ sudo kill -SIGTERM 3486

Sometime signal # 15 is not sufficient. For example, lighttpd may not be killed by signal #15 due to open sockets. In that case process (PID) # 3486 would be killed with the powerful signal # 9:
# kill -9 3486
# kill -SIGKILL 3486

$ sudo kill -9 3486
$ sudo kill -SIGKILL 3486


  • -9 or -SIGKILL – A special kill signal that nearly guarantee to kill the process with the iron fist.

How do I kill two or more Linux PIDs?

The syntax is as follows to kill two or more PIDs as required can be used in a single command:

kill  pid1 pid2 pid3
kill -15  pid1 pid2 pid3
kill -9  pid1 pid2 pid3
kill  -9 3546 5557 4242

Say hello to killall command

The killall is a Linux only command. It may be available on FreeBSD and other Unix like systems such as macOS to kill processes by name. So no need to find the PIDs using the ‘pidof process’ or ‘ps aux | grep process’ commands. Do not use the killall command on Solaris Unix operating systems. The syntax is:

killall {Process-Name-Here}
killall -9 {Process-Name-Here}
killall -15 {Process-Name-Here}

To kill the lighttpd server, enter:
# killall -15 lighttpd
# killall -9 lighttpd
To kill the Firefox web-browser process, enter:
# killall -9 firefox-bin

Summing up

You learned how to list and kill a process from the Command Line under Linux and Unix-like operating systems. As I said earlier, the killall command on UNIX-like system does something else. It kills all process and not just specific process. Do not use killall on UNIX system such as Solaris server. See your local man page for more info by typing the man command:
man kill
man killall

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 101 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
101 comments… add one
  • kavita Dec 19, 2006 @ 8:34

    how to kill a process using system call?

  • ganesh Oct 24, 2007 @ 9:00

    Kill are of two types:

    1.Graceful Kill
    kill -15 pid
    2.Forcible Kill

    Kill -9 pid.

    Kill pid. This format wont work.. Just check it..

    These kill differs in releasing resources forcibly or gracefully……….

    • Dhruv Collins Apr 14, 2015 @ 7:25

      Kill PID works for me im running Debian 7 Wheezy…

    • Yassine Sedrani Aug 5, 2016 @ 3:05

      some pid need root so su -c ‘kill pid’ will work
      it work for me on fedora 24

  • Josir Nov 27, 2007 @ 12:56

    I login as root, kill -9 a process but it refuses to stop. Is there a more powerful command?

    • kavya Oct 11, 2010 @ 3:35

      use top command it will list the running processes dynamically then press “K” it will ask for process ID(PID) so enter the PID of the process you want to kill.

      • sathishvarma Jun 24, 2016 @ 13:59

        it works thanks

  • Shehab Feb 26, 2008 @ 14:07

    the kill pid works fine if u’re logged in as the root.

    • charles Oct 23, 2014 @ 14:39

      Also if you’re logged in with the user who started the process…

  • Manojg Jun 6, 2008 @ 13:47

    I tried to kill a process by kill -9 PID in user as well root mode. But it could not kill the process. What is another way to force kill?

  • mircea Jun 26, 2008 @ 18:00

    Is the process changing PID after your kill -9 command? Because if it does it means it is a new process. This usually happens with apps that are beeing watched by some other process that will respawn the dead process.
    To kill such a process you first need to find out what are the means used to respawn it and act accordingly. A “ps axf” will show you the relationship between processes. If the preocess you try to kill is a child of other process then it is most likely that the parent is respawning the child. So you will need to kill that process first. Otherwise, kill -9 used as root is “invincible” :)

  • Shivin Vijai Dec 3, 2008 @ 9:07


    One small doubt .

    I know parent of all process is init and its PID is zero. Can i kill pid zero? What happend to the system if i kill pid zero?


    • Vivek patel Dec 6, 2015 @ 19:43

      Init pid is not zero. init have pid 1
      Swapper has pid of zero

  • Ethan "eekee" Grammatikidis Jan 23, 2009 @ 1:02

    I have a process that will not respond to any kill signal, nor can bash suspend it, nor did it react on removal of the USB device it was trying to access. I’m told it could be a buggy driver holding a global semaphore or “oopsed”, whatever that is. I guess there are some things that only a reboot will fix. :)

  • Jeff Feb 5, 2009 @ 19:12

    If it is respawning based on an entry in your inittab then you can modify the inittab (eg. remark the entry out) then issue :

    /sbin/telinit q

    telinit is linked to init and the q flag tells init to re-examine the inittab file.

  • karthickelc Feb 19, 2009 @ 12:09

    i have inserted a pendrive in suse linux sp10. when i try to remove the pen drive the dialog displays device busy and shows its process id. every time i use the command kill -9 pid .
    how can i avoid this?

    • Ankit Anant Aug 30, 2010 @ 11:18

      When ever you insert you pen-drive to your system, it gets mounted in a particular directory, by default it mounts in /media in most OS. It is quite possible that you have not unmounted that pen-drive from that directory to which it has mounted.

  • Klimentine Apr 26, 2009 @ 12:33

    Thanks for this tuto, is simple and easy to use

  • maibangcomputer May 6, 2009 @ 5:34

    thank you, it works…

  • Sanjay May 15, 2009 @ 14:25

    Thanks a lot dude!!!

  • Shinnosuke Jun 26, 2009 @ 22:56

    I got a window I cannot close, it is on top and I cannot access to the menus. I cannot move it either, the cursor cannot be moved outseide that window. So the only way to close the application should be a key combination, isn’t it? But which? (BTW, I’m a complete newbie, trying Ubuntu for the first time)

  • sshah Jul 7, 2009 @ 8:00

    Anybody can guide me how can I kill time based processes? for example I want to kill processes that are 1 day old.

    • Russel May 17, 2011 @ 7:08

      I was having this same problem. I know you must have use the man and got frustrated after “killall -o 1d” didn’t work. It turns out that the important thing that we missed was that TIME must be a string. In other words …. “killall -o 1.0d”
      That works .

  • zaheer arif Aug 4, 2009 @ 11:49

    Dear I have a question.
    Suppose i have a function that does some calculations.Well what i want to do,I want to stop the calculations in that function after some time (suppose 5 seconds).I really appreciate if anybody guides me in this regard.

    thanks in Advance

  • vishnu Aug 7, 2009 @ 15:57

    Very very nice

  • zaheer arif Aug 12, 2009 @ 13:36

    What is nice ?

  • Natirips Aug 20, 2009 @ 17:42

    “nice” is how nice a process is. The higher the number, it will tend to let other processes use CPU more. If negative, it has higher priority that other processes. Zero (0) is normal. See “man renice” to see how to change the “nice” value.

  • linuxnaveen Aug 26, 2009 @ 10:10

    Dear Shivin,
    The Init is the parent of all the process.The PID no is always One (1).
    It’s an Parent of all the process so we called PPID.
    All the runlevels are run under init.So it’s look like parent of all the runlevels.
    If you kill the init ,then how it works…?

    Thanks & Regards,
    EverFriendly Naveen

    • Ankit Anant Aug 30, 2010 @ 11:24

      If someone kill the init process, will the run labels work? Will the other processes not effected ??
      Is there any other method?

  • linuxnaveen Aug 26, 2009 @ 10:33

    Dear Shivin,
    The root PID is zero (0)

    Run this command it will show
    pidof root
    pidof init

    The root is an User.The User informtions are stored in /etc/passwd file
    in this file show
    username,password,userid,groupid,gecos field,home directory,shelltype

    The third field denotes the UID of the User.

    Thanks & Regards,
    Ever Friendly Naveen

  • Ankur Sinha Sep 1, 2009 @ 7:28

    Nice Article!!!!

  • kunal Sep 10, 2009 @ 9:31

    how kill command proceed???

  • Raghavi Oct 22, 2009 @ 12:37

    iam getting this errror plz…. help me

    [xsxsx@ip-111-111-11-111 javautils]$ kill 20073
    -bash: kill: (20073) – No such process

    • Ankit Anant Aug 30, 2010 @ 11:27

      Please try to kill forcefully as:
      $kill -9 20073

  • Mircea Oct 22, 2009 @ 13:09

    This usually means exactly what the message says: there is no process with that id running. This may be due to short lived processes or simply a typo in the command line

  • Natirips Oct 22, 2009 @ 13:37

    If you’re shore that you’ve seen a process with that PID, it may have died/ended on it’s own before you could type the command. You can check if a process is alive with “ps -e” (without the quotes) and looking at the list, or just “ps -e|grep 12345” to see if a process with PID 12345 exists or not. Note that every time you start an application, it will get a different PID. So if you killed a broken MPlayer or VLC (for example), when you start it again it will have another PID. If you start two instances of it, each will have it’s own PID. Also, the same PID my accidentally later be given to a completely different application. So never remember PID of given process by long term means.

  • jw tech Nov 9, 2009 @ 19:55

    I am using the
    sudo killall -u root
    as root but once all the machines have been killed the command will not end/terminate I have to go in and click the stop button.

  • SonhadorPR Nov 24, 2009 @ 4:33

    Following a few of the commands, the kill -9 or kill -15 PID did not work for me, because it kept changing, like mircea had mentioned, it apparently was attached to another process. However, nobody told me how to find the other process…so I used the sudo killall -u root, mentioned by jw tech, and all it did was log me out of my session, however, for some reason it also killed the USB, because the mouse and keyboard did not respond.
    Had to manually turn machine off…waste of time, I could have turned off machine from beginning!
    Any other step-by-step commands for newbies like me?
    Let meknow: sonhadorpr_at_gmail_dot_com

  • Natirips Nov 24, 2009 @ 17:31

    killall -u root is only usefull if you’re trying to shutdown the machine “gently” as it kills everything it can.

    Use “$ ps -ejH” to display all processes in a tree. You might want to also “$ ps -ejH>tempprocesseslist;gedit tempprocesseslist;rm tempprocesseslist” to view the files nicely. Use ‘kate’, ‘mousepad’, ‘vi’, ‘nano’ or whatever instead of ‘gedit’ if you like/need.

    Btw, don’t type/copy-paste the quotes and the $ sign ^^.

    Now if you’re killing a process but it jumps back, maybe try killing/debugging it’s parent instead. Parent processes are those to the left (with less spacing at the left side) in the “tree”.

    ‘$ ps -ejH’
    Displays all processes in a tree. This part is almost absolutely harmless (it takes up a lot of screen space). Use shift+pageUp/pageDown to scroll through the list if you’re stuck in CTRL+ALF+F1-6.

    ‘$ ps -ejH>tempprocesseslist’
    Outputs to a file named ‘tempprocesseslist’ instead of screen. You can use any other filename istead of ‘tempprocesseslist’, but than you must use the same one in all three commands.

    ‘$ ps -ejH>tempprocesseslist;gedit tempprocesseslist’

    Also open the file in text editor.
    ‘$ ps -ejH>tempprocesseslist;gedit tempprocesseslist;rm tempprocesseslist’
    Also remove the file after it is no longer needed.

  • Mackie Mathew Dec 9, 2009 @ 4:40

    I like to get a tree view before killing off a process. Graphics make me happy :) and also useful when the process table is a bit too complex to grasp.

    If I want to kill firefox (No offence mozilla ;), this is what I use:

    pstree -p | grep fire*

    this displays:
    | |-{firefox}(28071)
    | |-{firefox}(28072)

    Then I would kill it using:
    kill -9 28060

  • Christer Jonassen Jan 1, 2010 @ 18:02

    Exactly what I needed to kill a troublesome process on my old Clark Connect box!

  • Busandi Lal Jan 25, 2010 @ 7:10

    Hey, you can also use grep command for killing the processes and ls is best known utility for this.

  • Natirips Jan 25, 2010 @ 12:31

    “grep” doesn’t kill a process, it is only used to filter output of other commands such as “ps” or “pstree”, at least in this context.

    “ls” has practically absolutely nothing to do with killing a process. It is used to list segments (usually files) in a directory.

  • Michael Jan 28, 2010 @ 14:06

    What Suse Linux permissions do I need to kill a process?

  • Natirips Jan 28, 2010 @ 15:26

    I’m not 100% sure as I’m not a Suse user, but this should do if you don’t have permissions to kill it:

    $ su
    # ps -e|grep part-of-process-name
    # kill -9 PID
    # exit
    $ echo continue with what you were doing

    Where PID is process ID (that number). You can use ‘pstree’ instead of ‘ps -e|grep blah’ if you want.

  • kay Mar 2, 2010 @ 11:11

    how can i kill safari?

  • Natirips Mar 2, 2010 @ 13:11

    OK. Here’s step-by-step how to kill anything.

    Open a terminal (Konsole, Terminal, xterm, gnome-terminal, or press CTRL+ALT+F1*). Don’t type in the $ and # signs. Those indicate the beginning of a line which you have to type. *You can use any key from F1 to F6 here. Press CTRL+ALT+F7 to go back to the GUI.

    $ ps -e
    If you don’t see the whole list, you can scroll up and down with SHIFT+PAGE_UP and SHIFT+PAGE_DOWN.

    Find the process’ number and type:
    $ kill 12345
    Where 12345 is the number of your process.

    If it didn’t die, type:
    $ kill -9 12345
    Where 12345 is the process’ number.

    If it still didn’t die, type:
    $ su
    # kill -9 12345
    # exit
    You can also use:
    $ sudo su
    instead of “$ su” if you don’t know/have the root password but you happen to be a sudo-er.

    If it still didn’t die, type:
    $ pstree
    Now find process’ parent process (the one to the left of it), and repeat everything for the parent process.

    Warning: don’t try killing “gdm”, “kdm”, “xdm” or “init” unless you really know what you’re doing.

    You can also use:
    $ pkill fullprocessname
    instead of
    $ kill processnumber
    You can usually see the full process’ name in the “pstree” and “ps -e”, next to it’s number.

    If you want to kill all instances of something, type:
    $ killall fullprocessname

    Full process name may be different from the program’s name, for example firefox’s full process name may be “firefox-bin” instead of just “firefox”.

    Both pkill and killall can use -9 parameter as well. This parameter tells it to kill forcefully (and not gently). For example:
    $ pkill -9 firefox-bin
    $ killall -9 npviewer.bin

  • kay Mar 2, 2010 @ 14:40

    many thanks
    do you know how can i remove an application using unix command?

    • kashyap May 24, 2011 @ 5:31

      use rpm -e

  • rajeev Mar 29, 2010 @ 11:10

    What is the method used for killing init process using kill command?
    During shutdown of the system, the init process is killed by the kernel , I want to know is their any method to kill it using kill command so that i can shutdown my computer on killing the init process.

    please do reply?

  • Natirips Mar 29, 2010 @ 18:23

    You may be looking for this: http://en.wikipedia.org/wiki/Magic_SysRq_key

    So alt+sysrq+o shuts down the system.

    Otherwise init always has PID 1, so “sudo kill -9 1” or “sudo pkill -9 init” or “sudo killall -9 init” will kill init abruptly. Use -15 instead of -9 or omitt it completely to do it more “gently”, although kill init itself isn’t very gentle method >_<.

  • Anonymous Apr 2, 2010 @ 12:10

    what is force killing of process?how can it be done?

  • unfa Apr 4, 2010 @ 22:04

    Thanks a lot! That is what I’ve been looking for half a year since started playing Nexuiz – it tends to block Gnome sometimes when i try to shut it down, killall didn’t help, now -9 parameter did the job. Before I got here, I had to restart X server using Ctrl+Alt+BckSpc and I was unable to save mo work in other programs. Now i just go: Ctrl+Alt+F1, username, password, killall -9 nexuiz. Thanks again! Terminal rocks :D

  • Taqi Ahmed Taha Apr 26, 2010 @ 17:23

    I have a PHP CLI script on a UNIX machine that gets terminated after some time.
    How to check if a process is terminated ? where do i look for to check if the process received a termination message ?
    The script is to run for about 5 hrs how do i achieve this.
    i am currently using php script_name.php
    I have read about nohup but is nohup immune to Kill command.
    I think someone either the administrator or the OS is killing the process. Is this possible, if so how do i stop this and make my script run for longer time.

  • lowell May 12, 2010 @ 18:23

    “As I said earlier killall on UNIX system does something else. It kills all process and not just specific process. Do not use killall on UNIX system (use kill -9).”

    This is inaccurate.

    Mac OS X, one of the nine certified UNIX03 (which, despite the designation, is the current standard) operating systems, uses an implementation of killall which behaves as it does in Linux.

    I’m not pointing this out to be pedantic, it saves keystrokes over the “(find the process’ #pid) `kill -9 #pid`” routine.

  • Kaustubh May 21, 2010 @ 2:29

    How do i kill a program, cleanly. I used killall on transmission, but everytime it starts, it goes on to verify the files. Thanks.

  • chrysa May 26, 2010 @ 14:45

    how can i kill ‘inside a script’ my other terminal (having open 2 terminals) and find which is the other one too.????tnx :)

  • Ganesh Jun 18, 2010 @ 13:34

    I am using sify internet. they provided one 24online client software for login. it is binary which directly run with help of user name. when 1st time I tried it asks me dns. It create conf file and I got massage that I logged in. for week I used same command like: ./crclient -u xyz123 and I get connected to internet. one day I was connected to internet lost connection due to electricity. I use to logout command like ./crclient -l. I tried to login and getting massage that
    already logedin process id 2951. if I see process using ps -el of pgrep 2951 there is no process. I tried many things like shut down pc. reboot, kept for week off, but still same massage comming from. also I tried to do like install again. I could not understand if there is no process running then why it is saying that it is running. can any one help to stop it.
    How to find out which process is not running?

    • 🐧 nixCraft Jun 18, 2010 @ 14:43

      It may be using pid file stored in /var/run directory.

  • Nabil M Jun 23, 2010 @ 17:58

    kill -9 `ps ux | awk ‘/java/ && !/awk/ {print $2}’`

    replace the word java with wather is your process name

  • Peter Jul 25, 2010 @ 23:47

    There are two types of processes kill can’t remove: Immortal and Zombie, as explained in this note:


    For those who don’t read technical stuff well, it basically says, iirc, a zombie is a child that has died, but not yet reaped by its parent. It uses no resources other than its process entry. Since the zombie is essentially dead, it cannot be killed again. If the parent itself dies before reaping the zombie, the child becomes an orphan and reparented to ‘init’ (the parent of almost all processes). When init waits for its children to die, it will also reap orphaned and its own zombie processes. Zombies are therefor dead processes waiting to be reaped by their parent/init. They should not exist for very long, seldom long enough for ps to list them.

    An Immortal process is one that cannot be signalled because it has a priority higher than the signaling threshold: It won’t get signals sent by kill. Processes that use system critical resources (such as a disk drive) are temporarily given higher priority and therefore cannot be killed while accessing those resources. If the process waits for input from the resource, such as ‘transfer completed’, which never arrives because the devices was removed (for example), then the process can wait forever and becomes Immortal.

    Now, if the parent is an Immortal process, and its child dies (either naturally or via the kill command), the child becomes both a zombie and immortal. It cannot be killed because it is already dead, it exists to be reaped. Its parent will never reap it and can’t be killed because it is blocked by system critical resources and won’t get any signals. Neither can init reap the zombie as an orphan because the parent still exists, and, kill can only kill live processes, not dead ones, so it can’t remove the zombie. Neither can kill remove the parent because the kernel (linux) won’t pass signals to it.

    The only solution in this case is to reboot.

    The difference between a respawned process (one that re-appears after being killed) and a zombie, is that the respawned process will (normally) have a different pid, while the zombie pid will always be the same. If it is a zombie, then the parent should reap it, otherwise go after the parent (ppid). If init is the parent and not reaping the zombie, it probably isn’t healthy and needs attention.

    The difference between a Zombie and an Immortal process is that the zombie is dead and holds no resources, while an Immortal process has a high priority that prevents it from getting signals, is alive, and holding/consuming resources. Both zombie and immortal processes retain their pid after being ‘killed’.

    Mostly, kill works just fine to remove buggy programs, but its the stubborn zombies and (more importantly) immortals where kill fails. I suspect the reason is that kill does not actively kill anything, but passively sends signals, assuming the target will ‘do the right thing’. For zombies and Immortals, they can’t or won’t. Apparently there is no nuke to smash these processes and mark all their resources as ‘available’. Perhaps a reboot is safer than risking the kernel screwing up its resource allocations and (silently) trashing system/user data?

    I did find your article informative, the pidof with kill is exactly what I’ve been looking for. The answer to killing zombies and immortals is not what I wanted, but at least I know I’m not missing something (am I?).

  • vadivel Sep 24, 2010 @ 6:20

    i am first time using linux,please tell me all the commands for linux and main usage for current process for killing.

  • Ilias Oct 29, 2010 @ 8:37


    Anyone knows how to kill all the processes from a specific username from TOP command? Usually you have to indicate the PID, but i would like to kill all the PIDs from a user.


  • Vamsi Nov 28, 2010 @ 12:02

    Nixcraft rocks :D

  • robby Nov 29, 2010 @ 5:39

    thanks mathew for pstree -p |grep process_name

  • mocca Jan 23, 2011 @ 16:02

    what is the differences between unix process and signal?
    can you give an example please..

  • Abcdef Genie Feb 11, 2011 @ 19:58

    Yessss. Finally got all my 40 apache2 processes to kill themselves. :) Thanks.

  • LA Feb 14, 2011 @ 23:51

    Can anyone tell me how to kill users who are logged into the terminal (I.E.: tty), I currently show eight users logged in and there is only one profile besides root. There should not be eight users. I have one terminal open. Thanks for your help.

  • Rohit Feb 28, 2011 @ 5:14

    Hello i not able to get the PID of the process which i need to kill.
    I used pidof (process name),ps -A ,top command but i not got pid of the process

  • Soundarapandian Jul 22, 2011 @ 12:47

    Thank You.Very useful :)

  • abhishek dilliwal Sep 15, 2011 @ 10:11

    great compilation buddy it helped… its man pages in simple way… thanks anyways

  • rajendra pandey Sep 20, 2011 @ 14:17

    i wanted to know could i use kill -9 -1 command
    To kill the Process ID in UNIX

  • davea0511 Sep 24, 2011 @ 19:46

    Nabil –

    You are a total stud. That’s what I was looking for … the only way to kill a process by name (not PID number) that worked.

    For those who didn’t get it the first time…

    kill -9 `ps ux | awk ‘/java/ && !/awk/ {print $2}’`

    Then replace the word java with wather is your process name.

    I used this to kill chromium gracefully (with a kill -15), then restart it 5 seconds later … that gets rid of the pesky “Chromium didn’t shut down correctly” message.

  • Reji Nov 11, 2011 @ 10:24

    Very nice site.,great explanation

  • sathiyanarayanan Nov 26, 2011 @ 18:14

    For what purpose we use -9 option in kill command , what is the difference between kill and kill -9 .

  • Kaja Dec 30, 2011 @ 21:34

    This so helpful! Thank you :). I used to use command sudo killall skype and wondering why it did not work haha.

  • sathiyanarayanan Jan 3, 2012 @ 4:51

    Hi Friends i know how to kill process , but -9 option for what purpose we are using , how to clear zombie process in process tables ?

  • nobody Feb 9, 2012 @ 21:05

    in a shell, press strg+c to stop (e.g. if you started an extraction that should have been started as root, but you started it as user)

  • niro Feb 21, 2012 @ 6:54

    pidof firefox | xargs kill

    love it

  • powerpawn Mar 6, 2012 @ 1:23

    Hey guys! I have a process that changes PID every time I kill its parent. I have also tried the process itself. The conditions are:
    I am using screen
    The process is being used but wont tell me whats using it even if I try a ps afx

    Any help would be wonderful as it is taking up a important port on the server and I cant run any other programs with it on that port. Thanks!

  • Jagadish Mar 17, 2012 @ 9:34


    I have a requirement like killing some 20 to 30 process from linux. suppose if i want to kill a single process i will use kill -9 . Is there any way to proceed on killing multiple process related to same instance.

    Note: in the same linux server i have 3 Oracle Instances are running.. NO other instance should be affected for this.

    Can anyone help on this.?


  • chacha Apr 11, 2012 @ 18:25

    Hi all!,
    I like your comments .
    i am running a MIP model using glpk package in Ubuntu terminal,but i got the text killed at the end.
    what should i do .i’m usinng a matrix dimension of 95×95.
    when using matrix dimension 40×40 the package works successfully.
    help please!

  • chacha Apr 11, 2012 @ 18:28

    note that i am using 32bit windows

  • sashenk May 26, 2012 @ 14:03

    I’m wondering how to kill a tcp connection by entering the connection PID.Please help me.

  • thulasi Jun 1, 2012 @ 12:42

    may i know how to kill a unknown pid.
    while entering ps command it is showing that login details but the program is running on another telnet in that the program is in middle ,it is stucked .can you please suggest some one..

  • Chika Tambun Jun 27, 2012 @ 13:50

    [root@elang ~]# yum update
    Loaded plugins: fastestmirror, security
    Existing lock /var/run/yum.pid: another copy is running as pid 4562.
    Another app is currently holding the yum lock; waiting for it to exit…
    The other application is: yum
    Memory : 44 M RSS ( 86 MB VSZ)
    Started: Wed Jun 27 06:05:35 2012 – 00:01 ago
    State : Uninteruptable, pid: 4562

    Exiting on user cancel.
    [root@elang ~]# kill -9 4562
    [root@elang ~]# ps aux|grep yum
    root 4562 0.0 7.9 87792 44764 pts/1 D+ 06:05 0:00 /usr/bin/python /usr/bin/yum update
    root 4792 0.0 0.1 4016 676 pts/2 R+ 06:05 0:00 grep yum
    [root@elang ~]#

  • newbie Sep 20, 2012 @ 12:42

    thanks, this article solved my problem

  • Hardik Oct 9, 2012 @ 18:33

    Hey i want diffrent multipal pid Of Firefox Bcz I want Close Only ne window(Not Tab) of Firefox
    ans Me as Soon as fast

  • joseph Oct 11, 2012 @ 15:02

    Thaks..its very funny all this ..killall.
    ..its sound to kill em all..like the clasic metallika disk..sorry,i rmember
    the unix philosophy:“ unix:uniqie,only one way to do
    .something…well,there many..amd thatts its funny too
    by the way good post..its solve my problem too

  • Saravanan T Mar 19, 2013 @ 14:24

    Hi Guys,
    i need to know the process id of the last killed process and who killed the Process?. where i can get that?

    please help me…


  • tadag Apr 22, 2013 @ 10:04

    thank you for this. was easy to understand and apply.

  • Mudassir Aftab Jun 12, 2013 @ 15:47


    1. How can i kill 50 old pid’s of particular precess ?

    2. How can i kill 50 old pid’s of particular process when it reached to 100 using cron ?

    Thanks in advance.


  • Mudassir Aftab Jun 12, 2013 @ 16:07

    How can i kill 50 old pid’s of particular process when it reached to 100 using cron script?
    ps -elf | grep myscript | head -n 50 | awk ‘{print $4}’ |xargs kill -9

    Mudassir Aftab

  • npn Aug 16, 2013 @ 10:42

    Don’t forget we also have `killall’ which will terminate processes by process name, by default with a SIGTERM.

  • sandeep Jun 8, 2014 @ 21:45


    I have a list of servers for example say 1 to 10
    How would i able to see the process id’s for all at a time

    Is there any command to get it


  • Paul Nov 10, 2014 @ 22:11

    Typo in title “A list of common Term singles” s/b “A list of common Term signals”

  • Tushar Jan 18, 2015 @ 19:34

    Got below message on centos 6.3.
    usage: kill [ -s signal | -p ] [ -a ] pid …
    kill -l [ signal ]

    how to kill please suggest

  • Pauline Feb 9, 2015 @ 8:51

    I have started the processes in windows with a top command but I failed to stop it. Please I need a help.

    • Paul Feb 9, 2015 @ 20:04

      Pauline, this is the wrong forum for your question, but just type ‘q’ to quit the top program.

      Google “man top” and you’ll find this quite near the beginning:

      When operating top, the two most important keys are the help (‘h’
      or ‘?’) key and quit (‘q’) key. Alternatively, you could simply
      use the traditional interrupt key (‘^C’) when you’re done.

  • cameron Dec 19, 2015 @ 4:21

    thats why it does not work on any red hat distros

  • Shameel Jan 5, 2016 @ 10:26

    Can we pipe the process id to kill command?
    I tried doing like
    sudo kill -9 | pidof motion
    It is not working, any other ideas.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum