What's the command prompt's equivalent to cygwin's ctrl+z

Whenever I want to quit something in Cygwin, Ctrl + Z usually does the trick.

What's the equivalent in the command prompt?


Solution 1:

Depends on what you mean by "quit something"; within Windows cmd:

Ctrl+Z sends the EOF character, which could terminate a process if you're providing input, but otherwise will probably do nothing.

Ctrl+C normally sends SIGINT to the foreground process, which should terminate it, but programs can respond however they like - ie, they can catch the signal but then ignore it. The command can also be remapped to other jobs (such that for a specific program it doesn't really send a signal) or ignored entirely.

Ctrl+Break always sends SIGBREAK, which again should terminate the process, but unlike Ctrl+C cannot be remapped, but can still be ignored. This is probably what you need.

Here's a source: MSDN article: CTRL+C and CTRL+BREAK Signals.

Solution 2:

It's Ctrl-C, if you want to cancel a long DOS command (e.g. C:\>dir /s)