How To replace Control-M in all files in a folder

To remove control-M or ^M from all the documents in the current folder run the following,

$> perl -p -i -e 's/^M$//' *

NOTE : Do not copy and paste this text.
You have to type in the test and when you get to the ^M you have to do a CRTL+V then a CTRL+M

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s