Break command "\" not working in Mac Terminal

A couple thoughts, @ehickman
The \ is an escape character in BASH, and escapes only one following character. It allows you to create a line break without running a command, because it’s telling the system to ignore the ‘line feed’ character created by the enter key.

If you are typing these commands manually, be sure there are no spaces after the \.
If you are copy-pasting these commands from a file built on a Windows system, that may be the source of the problem. Windows uses two characters (‘carriage return’ and ‘line feed’) to indicate line breaks.

If this is your situation, you may be escaping only the first of those two characters when you hit enter, and the unescaped ‘line feed’ may be telling the shell that it’s time to run the command.

Hope this helps!
Chris

5 Likes