Linux, programming, computers and life

July 23, 2005

Jobs/Processes and killing them

Filed under: CLI

When an application in Linux is launched, and i mean any application, process number is assigned to it. When you want to kill one, number-based or name-based killing is possible. Obviously killing is required only for ’stuck’ applications, normal exiting is the preferred way.

  • In order to kill a process with known id (number):
  • kill [-9] process_number

    if ‘-9′ is used it’s a unfriendly kill, will kill stuck jobs also

  • In order to kill a process with known name, use:
  • pkill [-9] partial_name

    Note that it’s dangerous since partial_name can be a part of the name, i.e. “pkill r” - will kill all jobs with ‘r’ in name.
    There’s also

    pgrep [-l] partial_name

    which will display all the matching process numbers, ‘-l’ (which comes from “-long”) will display the name also.

Conventions:
[foo] - optional

,

Comments »

The URI to TrackBack this entry is: http://linux4all.blogsome.com/2005/07/23/jobsprocesses-and-killing-them/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers