source command not found: ^M – bash.rc / zshrc config files

The error message:

command not found: ^M

Happened to me due to my file having the wrong type of carriage returns in my zshrc.config file. Once I changed myย  line endings to ‘\n’ instead of the Windows CRLF line endings the error messages went away ๐Ÿ™‚

You can check if a file is using CRLF or LF by using the ‘file‘ command in linux.

$ file what\ lol.txt
what lol.txt: ASCII text, with CRLF line terminators

Error message being fixed:

Leave a Reply

You are currently viewing source command not found: ^M – bash.rc / zshrc config files