A process is a running program with a PID. ps takes a snapshot; top updates live.
ps aux --sort=-%mem | head # biggest memory users
ps -ef | grep nginx # find a process (the grep shows itself too)
top # press P for CPU, M for memory, q to quit
pgrep -a sshd # PIDs and command lines by name
Stop processes with signals, politely first:
| Command | Signal | Effect |
|---|---|---|
kill PID |
SIGTERM (15) | Ask the process to exit and clean up |
kill -HUP PID |
SIGHUP (1) | Many daemons reload configuration |
kill -9 PID |
SIGKILL (9) | Kernel ends it at once, no cleanup |
Use -9 only when TERM is ignored; it can leave lock files and half-written data. nice -n 10 command and renice lower a job’s priority so it does not starve interactive work.