Linux pkill Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux pkill Guide
Complete beginner-friendly guide to pkill on Linux, covering Arch Linux, CachyOS, and other distributions including killing processes by name, pattern matching, and process management.
Table of Contents
Understanding pkill
What is pkill?
pkill kills processes by name.
Uses:
- Kill by name: Kill processes by name
- Pattern matching: Match process names
- Process management: Manage processes
- Batch killing: Kill multiple processes
Why it matters:
- Convenience: Easier than finding PID
- Pattern matching: Match multiple processes
- Process management: Manage processes easily
pkill Basics
Kill by Name
Basic usage:
# Kill process by name
pkill process-name
# Sends TERM signal (default)
Pattern Matching
Match pattern:
# Match pattern
pkill -f "pattern"
# -f = full command line
Pattern Matching
Exact Match
Exact name:
# Exact match
pkill -x process-name
# -x = exact match
Case Insensitive
Ignore case:
# Case insensitive
pkill -i process-name
# -i = ignore case
Signal Options
Send Signal
Specify signal:
# Send specific signal
pkill -9 process-name
# -9 = KILL signal
pkill -TERM process-name
# -TERM = terminate signal
List Matches
Show matches:
# List matching processes
pkill -l process-name
# -l = list (doesn't kill)
Troubleshooting
No Processes Found
Check processes:
# Check if process exists
pgrep process-name
# Or
ps aux | grep process-name
Summary
This guide covered pkill usage, pattern matching, and process management for Arch Linux, CachyOS, and other distributions.
Next Steps
- kill Guide - Kill by PID
- killall Guide - Kill all processes
- pgrep Guide - Find processes
- pkill Documentation:
man pkill
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.