At a command line or when running a script, pressing Ctrl + C can abort a command, program, or script stuck in a loop.