29

In Linux terminal if I run a command like:

$ node httserver.js

The command runs and by doing ctrl + c the program is terminated and new line comes in terminal for us to enter a command.

I felt ctrl + c as the macOS terminal keyboard combo to do that but it doesn’t work.

Giacomo1968
  • 58,727

7 Answers7

50

The accurate answer for MAC Keyboard on terminal is:

Command + . (dot/period)

This is equivalent to Ctrl + C or break.

Refer to the:

Terminal Help > Keyboard Shortcuts > Other Shortcuts > Break

The Control or Ctrl key is not a regular modifier in macOS.

However, if you are using a regular Windows keyboard with macOS then Ctrl + C works since there is no Command key in this case.

Giacomo1968
  • 58,727
10

Try:

Ctrl + C

It should be the same as Linux.

Duplicate of: this question

Giacomo1968
  • 58,727
Dan Smith
  • 633
7

Try Ctrl + Z

Or you can use kill Command. For further information see man kill command for manual of kill command and you can get some guidance from this link about how to use kill command.

Giacomo1968
  • 58,727
3

Try Shift + Command + C worked for a friend.

Giacomo1968
  • 58,727
1

If you are using iterm2, you might need to look into Preferences -> Keys -> Remap Modifiers. In my case, control (^) was mapped to something else by default. After mapping it to control (^), the shortcut worked.

fynnlyte
  • 111
0

Typing Ctrl + h took me to a help thing where it showed me the letter to type to exit. In my case, it indicated I had to use Ctrl + q.

clmpt
  • 1
-1

If you are using VSCode: Ctrl+Z works just fine.

Toto
  • 19,304