Chapter 3: Linux Basic Commands
3.8 Processes
A process is a running program. Each has a PID (process ID).
| Command | Purpose |
|---|---|
ps aux |
All processes with user, CPU, memory |
ps aux | grep nginx |
Find a specific process |
pgrep -a node |
PIDs and command lines matching a name |
top |
Live view (press q to quit, M sort by memory, P by CPU) |
kill PID |
Politely ask process to stop (SIGTERM, 15) |
kill -9 PID |
Force kill (SIGKILL) — last resort |
pkill -f app.py |
Kill by name/pattern |
command & |
Run in background |
jobs, fg, bg |
Manage background jobs of the current shell |
nohup command & |
Keep running after you log out |
uptime |
Load average and how long the system has run |
free -h |
RAM and swap usage |