How to Kill a Process from the Command Line

By eHow Computers Editor

Rate: (0 Ratings)

When an application is hanging or an unwanted process is running on your PC, the best response is to kill the process directly from the command line. The steps to kill a process from the command line are relatively simple. The important thing is to be sure you’re killing the right process.

Instructions

Difficulty: Moderately Easy

Things You’ll Need:

  • Computer running Linux
Step1
Open the BASH terminal. This can be found at the bar on the bottom of the desktop in the Gnome and KDE interfaces. If you’re operating a non-Gnome or non-KDE variant, search the home menu for “xterm.”
Step2
Type in “pstree –p” (without quotes) and press "Enter." This will give you a list of all processes that are currently running. The “–p” will show the process ID as well.
Step3
Choose which process you want to kill. The name should give an indication. Try to remember the process ID.
Step4
Type “kill [pid]” where [pid] is the process ID number you noted in the previous step. This includes a delay to allow the process to end properly.
Step5
Verify that the process in question has been killed by repeating step 2. When the tree is listed, the process you specified should be gone.

Tips & Warnings

  • If the process does not seem to be ending properly, add the “-kill” modifier. This will bypass the delay and force the process to shut down.
  • A wildcard can be used if you know only part of the name. To shut down a process based on the whole or part of a process name, simply enter the command “pkill [word],” replacing [word] with a part of the process name.
  • Be careful not to kill a process vital to the operation of Linux. If you are unsure of the process’s function, do a Web search on the process name.

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article: How to Kill a Process from the Command Line

eHow Computers Editor

eHow Computers Editor

Category: Computers

Articles: See my other articles

Related Ads