Interview Prep/Linux/Processes, Signals & systemd

What is the difference between kill, pkill and killall?

BeginnerConceptProcesses, Signals & systemd
Answer
kill -TERM 1234             # by PID
pkill -HUP -f 'gunicorn: master'   # by pattern match on name or full cmdline (-f)
killall nginx               # by exact process name
pgrep -a java               # preview what would match

On Linux killall matches names; on Solaris it killed everything, a famous trap. Always preview with pgrep before pkill.

All Linux questions Roadmap: Linux

More on Processes, Signals & systemd