shortcutsguide

Stop a Running Command in Terminal (Ctrl+C)

Press Ctrl+C to stop a command that is running in your terminal. It sends an interrupt signal (SIGINT) to the foreground process. Same key on macOS Terminal, Linux and Windows WSL / Git Bash.

ActionMacWindows
Stop (interrupt) running command Ctrl+C Ctrl+C
Send end-of-input (EOF) / exit Ctrl+D Ctrl+D
Suspend command to background Ctrl+Z Ctrl+Z
Clear the current line Ctrl+U Ctrl+U

Interrupt whatever is running

Press Ctrl+C to stop the command currently running in the foreground. It sends the SIGINT signal, which most programs treat as "cancel now". This is the same in bash and zsh on macOS Terminal, Linux and Windows WSL / Git Bash.

Ctrl+C vs Ctrl+Z vs Ctrl+D

Ctrl+C interrupts (kills) the command. Ctrl+Z only suspends it — the job pauses in the background and you can resume it with fg. Ctrl+D sends end-of-input, which exits the shell or ends programs waiting for input.

When Ctrl+C does not work

Some programs trap or ignore SIGINT. If Ctrl+C has no effect, try Ctrl+\ (sends SIGQUIT) or suspend with Ctrl+Z and then run kill %1.

FAQ

How do I stop a command running in the terminal?

Press Ctrl+C. It sends an interrupt (SIGINT) to the running foreground command and cancels it. The key is the same on Mac, Linux and Windows WSL.

What is the difference between Ctrl+C and Ctrl+Z?

Ctrl+C stops (kills) the command. Ctrl+Z only suspends it to the background; resume it with the fg command.

Ctrl+C is not stopping my command. What else can I try?

Some programs ignore SIGINT. Try Ctrl+\ which sends SIGQUIT, or press Ctrl+Z to suspend then run kill %1.

Does Ctrl+C close the terminal?

No. Ctrl+C only cancels the running command; the shell stays open. Use Ctrl+D or type exit to close the shell itself.