I have a bash script I use to run XCode on OS X, which takes several minutes. I can't find the key command to stop it if I realize an error... on DOS I'm used to Ctrl+C/Ctrl+Z but neither seem to work. What am I looking for (on the standard OS X terminal)?
There are a few keypresses that should help you here.
Ctrl+C should send the foreground process SIGINT, and that should terminate the process unless you trap the signal with something like
trap INT ... in your shell code.
Ctrl+Z should send SIGSTOP, which would pause your process, again unless you trap your signals.
The mapping of key sequences jumps through some hoops, including terminal settings. What does
stty -a say on your computer? Look in the output for
intr, that's the keypress that should trigger SIGINT. If nothing is set, you need to set it, something like
stty intr ^C
As others have said, you can kill the process from another window as well.
To add on to what other users have said, you can also use Ctrl+\ which sends
SIGQUIT and is the same as
SIGINT except it also produces a core dump. I've found that programs which ignore
SIGINT often do not ignore
Based on the man-page for kill, you are also able to send a
SIGKILL to any process. You would accomplish this by finding your process in the process table (type
ps) and then type
kill -15 [pid] to send a
kill -9 [pid] to send a
SIGKILL (SIGKILL can't be ignored and will kill the process no matter what).