• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to kill a process

 
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI, could someone tell me how to kill a process on linux. Do anyone know a good and free tutorial??? thanks really,really!
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Carefully!
The man or info commands can tell you about killing processes. Type "info killall" (or "man killall") for a good start, then use info (or man) to look at the programs listed in the "SEE ALSO" list at the bottom of the help page.
One good way to kill processes is to use the "top" program ("info top"). For one thing, top shows the resource usage of tasks in the system so you can both looks at what might be wrong and use the top program to send a kill signal. Type "?" while running top for more help.
kill actually just sends a signal to a task. Unix/Linux have lots of signals. The default one is the TERM signal. A runaway app may not honor TERM, however. "kill 9" is a much more forceful signal, but I recommend avoiding it unless milder methods fail. It may bypass the program's internal cleanup routines.
The "ps" program can be used to list the processes that are running and the process IDs (or "pid"s) that are used to tell kill which process to signal. Most times if you kill the parent process, its children will be removed as well.
As I mentioned "kill" isn't really a program that directly kills processes. It just sends a signal. This is why you may see programs - especially daemon programs - using kill for nonfatal purposes. For example "kill -HUP `/sbin/pidof smbd`" would send the HUP signal to the Samba daemon, causing it to reread the samba config file(s) after they had been changed.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic