How 2 Know
If you can't Google it, You Can Knowing it.

Removing Control Characters

To Remove the Control Characters (^M) from File in Linux/UNIX do the following Steps:
1- Check the file first (You will see ‘^M’ on the end of each line): #cat -vte filename
2- open the file : #vi filename
3- press ESC button on Keyboard then press “:” (Command Mode)
5- write the following “1,$ s/^M//g”   (HINT: to write the ‘^M’ char on step Number 5, just press “CTRL+v+m”)
6- save the file using “:wq”
7- check the file again: #cat -vte filename

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from How 2 Know

Subscribe now to keep reading and get access to the full archive.

Continue reading