kill Command Examples in Linux¶
Introduction¶
These examples show practical ways to use kill on a Linux terminal. Each example is written so you can adapt it for administration or troubleshooting.
Example 1: Basic Usage¶
kill 1234
This is the simplest form of the command and is a good starting point before adding options.
Example 2: Common Admin Task¶
kill -TERM 1234
This example reflects a common task on RHEL, Rocky Linux, AlmaLinux, or similar systems.
Example 3: Useful Option¶
kill -HUP 1234
This option helps narrow the result, change behavior, or handle a more realistic target.
Example 4: Real-World Scenario¶
kill -9 1234
Use this pattern when the task moves beyond a single basic command.
Example 5: Verification¶
ps -p 1234
Example output:
PID TTY TIME CMD
Common Mistakes¶
- Using
kill -9first and preventing cleanup. - Killing a stale or wrong PID.
- Assuming all signals mean terminate; some services treat HUP as reload.
Quick Reference¶
kill 1234
kill -TERM 1234
kill -HUP 1234
kill -9 1234
ps -p 1234
Related Guides¶
Summary¶
Good kill usage means choosing the right option, keeping the target clear, and verifying the result with output you can explain.