What’s the difference between ^C and ^D for UNIX/Mac OS X terminal


When I try to stop something, I use ^C and sometimes ^D in terminal.

What's the difference between the two? Why some program doesn't respond to ^C, but ^D.
Why the Terminal.app just quits when I use ^D?

Best Answer

CtrlC tells the terminal to send a SIGINT to the current foreground process, which by default translates into terminating the application. CtrlD tells the terminal that it should register a EOF on standard input, which bash interprets as a desire to exit.