How to Kill a Running Process in Linux

First you must determine the PID of the process you want to kill. This can be done usually pretty easily with the top command in Linux. When you type top at the command line, it shows you the processes that are consuming the most resources at the time on the system. Most likely the one you will want to kill is near the top of this list.

By default the PID for each process is listed in the first column of the output. Look at the COMMAND column to determine which process it is (e.g., if it’s a Java program, it should be called java or something close), and then type k. It will ask on about the 6th line down for the PID to kill. Enter the PID of the process. It will then ask what signal you want to send. You can enter something descriptive or just hit Enter. That should kill the process (if you have rights to do this), and the process should no longer be listed in the top results (which are updated periodically).

Leave a Reply