Operations 4 min read

Four Powerful kill Command Techniques for Managing Linux Processes

This article explains how to use the Linux kill command with SIGTERM, SIGQUIT, SIGKILL, and SIGSTOP signals to gracefully terminate, debug, force‑stop, or pause processes while minimizing data loss and providing practical command examples.

Cognitive Technology Team
Cognitive Technology Team
Cognitive Technology Team
Four Powerful kill Command Techniques for Managing Linux Processes

In Linux systems, managing processes is essential for developers and administrators, and when a process hangs, using the kill command with the right signal allows graceful termination and data safety.

1. SIGTERM (15): Graceful termination signal

The default behavior of kill is to send SIGTERM, which asks the process to shut down cleanly, allowing it to perform cleanup. Run the simple command:

kill 123

Example output:

bogon:~ sdcui$ jps
73113 Launcher
72522 Main
73114 PdfviewerApplication
72716 RemoteMavenServer36
73118 Jps
bogon:~ sdcui$ kill 73114

2. SIGQUIT (3): Termination with core dump

SIGQUIT works like SIGTERM but also generates a core dump file that records the process memory state, which is useful for debugging.

kill -3 123

Note: Java processes do not exit on SIGQUIT; they only produce a core dump.

Example:

bogon:~ sdcui$ jps
73248 PdfviewerApplication
73259 Jps
72522 Main
72716 RemoteMavenServer36
73247 Launcher
bogon:~ sdcui$ kill -3 73248

3. SIGKILL (9): Forceful termination

When a process does not respond to SIGTERM or SIGQUIT, SIGKILL is the last resort. It tells the kernel to kill the process immediately, which may cause data loss.

kill -9 123

4. SIGSTOP (19) and SIGCONT (18): Pause and resume

SIGSTOP pauses a process without terminating it. You can later resume the process with SIGCONT.

kill -19 123  # pause process
kill -18 123  # resume process

Summary

Mastering the four key kill techniques—SIGTERM, SIGQUIT, SIGKILL, and SIGSTOP—enables you to handle stuck processes efficiently while avoiding potential data risks; start with SIGTERM or SIGQUIT and resort to SIGKILL only when absolutely necessary.

Reference: https://man7.org/linux/man-pages/man7/signal.7.html

process managementLinuxSIGKILLKill CommandSignalsSIGTERM
Cognitive Technology Team
Written by

Cognitive Technology Team

Cognitive Technology Team regularly delivers the latest IT news, original content, programming tutorials and experience sharing, with daily perks awaiting you.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.