Trapping signals
Remember the whole kill command? You can handle it!
Common signals:
Ctrl+C → SIGINT (2) → Interrupt process
Ctrl+Z → SIGSTP (18) → Stop/pause process
kill -9 → SIGKILL (9) → Cannot be trapped!
trap "<command to run>" <signal to trap>
trap "echo THIS IS A TRAP" SIGINT