killall
Overview
The killall
command kills processes by name. It sends a signal to all processes running any of the specified commands.
Syntax
killall [options] name...
Common Options
Option | Description |
---|---|
-e |
Require exact match |
-I |
Case insensitive |
-i |
Interactive |
-l |
List signals |
-q |
Quiet mode |
-r |
Use regex |
-s signal |
Send signal |
-u user |
Kill user’s processes |
-v |
Verbose mode |
-w |
Wait for processes to die |
-y |
Younger than time |
-o |
Older than time |
Key Use Cases
- Process cleanup
- Application restart
- User process termination
- System maintenance
- Batch process control
Examples with Explanations
Example 1: Basic Usage
killall firefox
Kill all Firefox processes
Example 2: Specific Signal
killall -9 httpd
Force kill all Apache processes
Example 3: Interactive Mode
killall -i process_name
Prompt before killing each process
Understanding Output
- No output on success
- With -v:
- Killed process information
- Error messages for:
- No process found
- Permission denied
- Invalid signal
- Pattern errors
Common Usage Patterns
Kill by age:
killall -o 15m process_name
Kill user processes:
killall -u username process_name
Wait for completion:
killall -w process_name
Performance Analysis
- Process name lookup
- Pattern matching overhead
- Signal delivery time
- Multiple process handling
- System resource impact
Additional Resources
Best Practices
- Use exact matching
- Verify process names
- Interactive mode for safety
- Check user permissions
- Document actions
Safety Considerations
- Avoid system processes
- Use interactive mode
- Verify process names
- Check dependencies
- Backup important data