Tuesday, July 5, 2011

Killing Processes in Linux

Some times you might have wished of stopping an undesired process from running further. In Linux this task is quite simple. The command kill is used to stop a process. 

The general syntax is 

kill processid

To get the processid of the required process use the command pidof.

The syntax is

pidof processname 


If you don't know the name of the process name, then type "ps aux" without quotes to get the list of running processes and their process id's.The output of this command is some what like shown below.

Example :


To kill a process named lightpad enter the following command.

pidof lighttpd

output 

3486

3486 is the process id of the process named lighttpd

using this we can kill this process as shown below

kill 3486


0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes