SHARE
Facebook X Pinterest WhatsApp

Things to Do With ‘kill’

Written By
thumbnail Juliet Kemp
Juliet Kemp
Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



Juliet Kemp

… other than what its name implies.

Tip of the Trade: ‘kill’ doesn’t just kill processes dead, it also can send processes a variety of other signals.

kill is most often used without an argument or with -9,
to kill a process off. But it can also be used to send various other signals
to a process. Some are variations on process termination, but you can
also get information about or out of processes.

Here are some you may find useful:

Recent Tips
» PuTTY and Xming
» DBAN
» UUID

Read All Tips of the Trade

  • kill -0 pid: This doesn’t actually kill the process, just
    returns 0 (success) if the process exists and 1 (failure) if not. The
    command itself will not give you any output — you have to look at the
    exit code, using echo $? to get the information. So as
    a one-liner:
    kill -0 1685; echo $?

    will output 0 if process 1685 exists, and 1 if it doesn’t. This can also
    be useful in shell scripts if you have a process number recorded and wish
    to check if it’s still running.

  • kill -9 pid: You probably already know that you can terminate the
    process WITH EXTREME PREJUDICE. kill -KILL does the same thing
    and has the advantage of looking more vicious. The downside is that it is an extra couple of characters to type.
  • kill -HUP pid: Restarts the process.
  • kill -INT pid: Another way of killing the process, this time
    by interrupting it. It is a useful halfway house between kill and
    kill -9.
  • kill -ABRT pid: Stops your program and gets it to dump core
    if possible/appropriate. (kill -6 is a synonym.)
    This can be useful if a process is misbehaving, as it means that you may get debug information.
thumbnail Juliet Kemp

Juliet Kemp is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.