Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Remove Control ^M from files

tpatil created the topic: Remove Control ^M from files

Single file method

perl -pi -e "s/\r//" filename.txt

Multiple File Method

find . -type f -exec perl -pi -e "s/\r//" {} \;

rajeshkumar replied the topic: Re:Remove Control ^M from files
I used to do in shell using following command

> 1,$s/^M//g

Correct me if I am wrong
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

tpatil replied the topic: Re:Remove Control ^M from files

Yes, this is also correct command if you want to remove ^M from single file in VI edit mode.

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x