Skip to Content
Navigation:

A stick figure smiling

Here's a preview from my zine, Bite Size Command Line!! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript".

browse more comics! get the zine!
read the transcript!

kill doesn’t just kill programs

you can send ANY signal to a program with kill!

$ kill -SIGNAL PID (name or number)

which signal kill sends

name num

kill => SIGTERM 15  
kill -9 => SIGKILL 9  
kill -KILL => SIGKILL 9  
kill -HUP => SIGHUP  
kill -STOP => SIGSTOP  

kill -l lists all signals.

  1. HUP
  2. INT
  3. QUIT
  4. ILL
  5. TRAP
  6. ABRT
  7. BUS
  8. FPE
  9. KILL
  10. USR1
  11. SEGV
  12. USR2
  13. PIPE
  14. ALRM
  15. TERM
  16. STKFLT
  17. CHLD
  18. CONT
  19. STOP
  20. TSTP
  21. TTIN
  22. TTOU
  23. URG
  24. XCPU
  25. XFS2
  26. VTALRM
  27. PROF
  28. WINCH
  29. POLL
  30. PWR
  31. SYS

killall -SIGNAL NAME

signals all processes called NAME
for example:

$ killall firefox

useful flags:
-w: wait for all signaled processes to die
-i: ask before signalling

pgrep

prints PIDs of matching running programs

pgrep fire matches firefox firebird
NOT bash firefox.sh

To search the whole command line (eg bash firefox.sh), use pgrep -f

pkill

same as pgrep, but signals PIDS found. Example:
$ pkill -f firefox

I use pkill more than killall these days.

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)