Control-M is a character found at the end of a line usually in files transferred from windows. Before, processing these files in UNIX, we need to remove the ^M characters. Let us see in this article, the different ways to delete the Control-M from the files:
Consider a file,
file1, which has the control M characters:
$ cat -v file1
a^M
b^M
c^M
d^M
e^M
f^M