117

Possible Duplicate:
Ending a process in unix instead of interrupting it

When I task in Terminal, such as ping blah.com, how do I then stop this task (other than closing the Terminal window. In Windows, you can Ctrl+Break pretty much any terminal based process, but I can't figure out the way to do it on the Mac.

1
  • This was useful to me coming from Linux. I had no idea Ctrl+Break was what I needed on Windows :) Commented Oct 28, 2015 at 14:18

2 Answers 2

132

Ctrl + C

Ctrl + C is a the standard *nix way of signaling a process to abort.

6
  • 15
    My Mac just beeps at me when I try this. Commented Mar 24, 2017 at 18:52
  • 22
    Mr. Tea: are you using Command instead of Control? Commented May 1, 2017 at 9:40
  • @heavyd, Why does man use q instead of ctrlC to quit? What's the rationale?
    – Pacerier
    Commented Aug 16, 2017 at 0:13
  • 5
    Ctrl + c does not work on zsh, MacOS Catalina. Commented Aug 19, 2020 at 14:18
  • 6
    Command + . is how you do it in Mac Terminal
    – Brian D
    Commented Oct 15, 2020 at 22:26
48

Try Ctrl + C. Also, Ctrl + Z might help if you want to suspend a process.

For further information, man kill.

If you're curious about the difference between suspend and terminate, this answer is a good starting point; the TL;DR version is, a suspended process can be resumed later and its execution can continue. A terminated (and killed) process will be gone.

3
  • 7
    Ctrl + c or ctrl + z does not work on zsh, MacOS Catalina. Commented Aug 19, 2020 at 14:19
  • 11
    Try CMD + (.) period/dot Commented Jun 15, 2021 at 9:42
  • 8
    CMD + (.) period/dot works!
    – Vivek
    Commented Aug 30, 2021 at 16:29

Not the answer you're looking for? Browse other questions tagged .