And since we're on this topic: if I write a for loop in bash that runs a slow command 1000 times (ImageMagick comes to mind), and I realise something has gone wrong, is there an easy way of breaking the outer loop?
If it's part of a script, your script probably wants to trap SIGINT.
How? Do you have a keyboard where | isn't Shift+\?
https://en.m.wikipedia.org/wiki/File:Keyboard_Layout_Norwegi...
^Z
fg
^C
the ^Z kills the loop, the fg and ^C cleans up the currently running one.
https://en.wikipedia.org/wiki/Control-%5C
https://en.wikipedia.org/wiki/Core_dump
https://en.wikipedia.org/wiki/Control-C
I remember doing:
sdb a.out . core
or something like that, in my C-on-Unix programming days earlier :)
sdb was a debugger.
UNIX one-liner to kill a hanging Firefox process:
http://jugad2.blogspot.in/2008/09/unix-one-liner-to-kill-han...
Some interesting comments on that post too, which go into slightly deeper details.