When one simply press "CRTL+M" together in VI, VI treats it as the "Enter" key. Therefore, one needs to "escape" the control key by using "CTRL+V" in front of the control characters.
Find "^M":
Code: Select all
/^M
Replace/remove "^M":
Code: Select all
:1,$s/^M//g
2. Type "CTRL+V" and "CTRL+M".
3.Type "/g" and "Enter" key to execute.