This tutorial is designed to show all of you Ubuntu and Kubuntu users out there how to end the bland cycle of waiting for a non responsive program to close or for that big “X” to respond to your click. Read below to find out how you can kill a program in a few easy steps and teach your computer who is boss.

The first step you must take is to find the “Process ID” or ”PID” for the process of which you wish to kill. The short 20 second tutorial for how to find the “Process ID” in Ubuntu and Kubuntu via cmd is linked below:


Now if you already know how to find the “PID” or have followed my tutorial linked above on how to find the “PID” then you may proceed to the next step, which is to type the text below directly into a “Terminal” window and then hit the “Enter” key (which should now be opened assuming you have just found the “PID” via the cmd):

kill xxxx                                         <— The “xxxx” I have typed must be replaced by the PID


As the highlighted text above shows, you must type the text “kill” follows by a single space and then the “PID” you have found for the process of which you wish to close.


For example, say I wished to closed the open program “Gedit” which has a “PID” of “6172”. I would type the text below and then hit the “Enter” key:

kill 6172


Note: If you are attempting to close a process being ran by another user, a select system process or any program that would otherwise require root permission to kill then you can try forcing a kill by using the “-9” addition on the “Kill” command like so:

kill -9 6172


Now that you have used the “Kill” or “Kill -9”  commands successfully and your program has closed or you have been presented with a message telling you that you do not have sufficient rights to perform the action, you might be wondering what the whole “-9” addition to the “Kill” command is right? Well that’s simple, the “-9” is telling the “Kill” command to send a special kill signal, which is known as the “SIGKILL” signal. The “SIGKILL” signal can be used as a fallback in the event that a regular “Kill” command does not work.

Congratulations! You have just killed a process via cmd in Ubuntu or Kubuntu. Enjoy your newfound Linux system administration knowledge.