What is `^M` and how do I get rid of it? - Unix Linux Stack Exchange The ^M is a carriage-return character If you see this, you're probably looking at a file that originated in the DOS Windows world, where an end-of-line is marked by a carriage return newline pair, whereas in the Unix world, end-of-line is marked by a single newline