interview-prep
Command What
ps aux All processes, BSD style
ps -ef All processes, System V style
top / htop Interactive process view (htop is friendlier)
pgrep <name> Find PIDs by name
pkill <name> Kill processes by name
kill -SIGTERM <pid> Graceful kill (default)
kill -SIGKILL <pid> (or kill -9) Force kill, no cleanup
nohup <cmd> & Run command immune to hangup, in background

Signals worth knowing:

  • SIGTERM (15) — please stop, allows cleanup
  • SIGKILL (9) — die now, no cleanup possible
  • SIGHUP (1) — reload config, often used by daemons
  • SIGINT (2) — interrupt (Ctrl+C)
  • SIGSTOP / SIGCONT — pause/resume

My notes