How to stop a process in Terminal

558,783

Solution 1

Ctrl + C

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

Solution 2

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.

Share:
558,783

Related videos on Youtube

gardenofwine
Author by

gardenofwine

Updated on September 17, 2022

Comments

  • gardenofwine
    gardenofwine over 1 year

    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.

    • Admin
      Admin over 8 years
      This was useful to me coming from Linux. I had no idea Ctrl+Break was what I needed on Windows :)
  • Kyle Bridenstine
    Kyle Bridenstine about 7 years
    My Mac just beeps at me when I try this.
  • Wizard of Kneup
    Wizard of Kneup about 7 years
    Mr. Tea: are you using Command instead of Control?
  • Pacerier
    Pacerier almost 7 years
    @heavyd, Why does man use q instead of ctrlC to quit? What's the rationale?
  • heavyd
    heavyd over 6 years
    @Pacerier, I can't really say why, you'd have to talk to the developers to figure that out. Processes can capture the Ctrl + C signal and do something else if they choose, but by default the behavior of Ctrl + C is abort the process.
  • Abhinav Saxena
    Abhinav Saxena over 3 years
    Ctrl + c does not work on zsh, MacOS Catalina.
  • Abhinav Saxena
    Abhinav Saxena over 3 years
    Ctrl + c or ctrl + z does not work on zsh, MacOS Catalina.
  • Brian D
    Brian D over 3 years
    Command + . is how you do it in Mac Terminal
  • Leo Caseiro
    Leo Caseiro almost 3 years
    Try CMD + (.) period/dot
  • Chris
    Chris over 2 years
    CMD + (.) period/dot works!