Process Management
Find and control running processes
Process management made simple. No more grepping through ps output.
Modern Process Viewer
If procs is installed, it's used automatically for enhanced output with colors and better formatting.
pme — My Processes
Show processes owned by current user:
pme
# Lists your processes
# Uses procs if available, falls back to psFilters out system processes you don't care about.
ptree — Process Tree
Hierarchical process view:
ptree
# Shows parent-child process relationships
# Useful for understanding process spawningSee what spawned what. Great for debugging daemon issues.
pwatch — Live Monitoring
Continuous process monitoring:
pwatch
# Like top, but filtered to your processes
# Refreshes automatically
# Ctrl-C to exitFinding Processes
pfind — Search by Name
Find processes by name pattern:
pfind node
# Lists all processes matching "node"
# Shows PID, CPU%, memory, commandCase-insensitive search through process names and arguments.
pgrep_custom — Full Command Search
Search through complete command lines:
pgrep_custom webpack
# Shows full command line for matching processes
# Useful when process names aren't uniqueResource Usage
pmem — Top Memory Users
Top 10 processes by memory:
pmem
# Sorted by memory usage descending
# Shows: PID, %MEM, RSS, COMMANDFirst command to run when system feels sluggish and you suspect memory issues.
pcpu — Top CPU Users
Top 10 processes by CPU:
pcpu
# Sorted by CPU usage descending
# Shows: PID, %CPU, COMMANDFind what's burning your CPU.
Killing Processes
pk — Pattern Kill
Kill processes matching a pattern:
pk node
# Finds all processes matching "node"
# Asks for confirmation
# Kills them (SIGTERM)Safer than killall because it shows you what it's about to kill.
fkill — Interactive Kill (fzf)
Multi-select processes to kill:
fkill
# fzf interface showing all processes
# Tab to multi-select
# Enter to kill selected (SIGTERM)Most user-friendly way to kill processes. See what you're killing before you kill it.
Workflows
Find and Kill a Process
# Find it
pfind runaway-app
# Note the PID
# Kill it
kill 12345
# Or use pattern kill
pk runaway-app
# Or interactive
fkill
# Search, select, killDebug Resource Issues
# High memory usage?
pmem
# Check top consumers
# High CPU usage?
pcpu
# Find the culprit
# Both?
htop # Or use a proper monitoring toolMonitor Process Over Time
# Watch specific process
watch -n 1 'ps aux | grep myapp'
# Or use pwatch for all your processes
pwatch
# For serious monitoring
htop # Interactive
btop # Modern alternativeKill Stubborn Process
# Try gentle termination first
kill 12345
# Wait a few seconds...
# Still running? Force it
kill -9 12345
# Or use pk with force
pk -9 patternFind Process Using a File
# What's using this file?
lsof /path/to/file
# What's using this directory?
lsof +D /path/to/dir
# Who has the camera?
lsof | grep -i cameraDebug Zombie Processes
# Find zombies
ps aux | grep Z
# Find their parent
ps -o ppid= -p <zombie-pid>
# Kill the parent (zombies can't be killed directly)
kill <parent-pid>Pro Tips
Use fkill for safety: Interactive selection prevents accidents. See what you're killing.
pmem and pcpu first: Before opening htop, run these. Often they're all you need.
Pattern matching is powerful: pk node kills all node processes. Use carefully.
SIGTERM before SIGKILL: Let processes clean up. Only use -9 when necessary.
Watch for memory leaks: If a process's memory keeps growing, it's probably leaking. Restart it.
htop/btop for continuous monitoring: These scripts are for quick checks. Use proper tools for extended monitoring.
Zombie processes: Can't be killed directly. Kill their parent process.
Use lsof for file locks: "File in use" errors? lsof shows what has it open.
Parent-child relationships matter: Use ptree to understand process hierarchies before killing things.