Other Help Topics :: 2 directories showing same name
The ^M character is not uncommon if you tend to switch between Windows and Linux a lot. If you edit a file in Windows it will insert ^M whenever you add a line break. If you stick with Linux exclusively, or don't use Windows to edit files, you will likely never see this issue.
^M is technically a non-printing character. Some applications handle it differently than others. As ^thehatsrule^ suggested, your terminal most likely interpreted it as a line break rather than a printable character, so it made a new line rather than displaying it in text.Thanks mik, that's a very helpful answer.
Yes, I was aware that Linux and MS use different EOL characters; that MS uses 2 and Linux only 1. I've faced the opposite issue before; dealing with a Linux file under MS. Now I know to be more careful in this direction as well.
Plenty of thanks, JohnSome text editors for Windows, such as UltraEdit (a commercial product), have a built-in feature to convert between DOS and UNIX format, and will edit a file in UNIX format if it is already in UNIX format. I wouldn't be surprised if there are free/open-source editors that will do this too. This can be very useful for editing Linux files in Windows, especially as the Linux dos2unix command has an annoying habit of changing file permissions when it converts a file.
Quote
I wouldn't be surprised if there are free/open-source editors that will do this too.