Stop a Running Command on macOS Terminal

If you are running a command or a script on the Mac Terminal and you want to know how to stop/terminate the execution and come back to your prompt then you can press Control + Z keys on your Mac keyboard.

Let's take an example where we ran a ping command, and want to stop it, just pressing Control + Z stops the execution as shown below.

Code2care@Mac % ping code2care.org

PING code2care.org (104.21.91.10): 56 data bytes
64 bytes from 104.21.91.10: icmp_seq=0 ttl=58 time=9.099 ms
...
64 bytes from 104.21.91.10: icmp_seq=4 ttl=58 time=15.527 ms
64 bytes from 104.21.91.10: icmp_seq=5 ttl=58 time=12.931 ms
^Z
zsh: suspended  ping code2care.org

The ^Z characters appear on the screen and the command got suspended.

Stop macOS Terminal Command

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!