{"id":2523,"date":"2017-12-08T12:57:21","date_gmt":"2017-12-08T12:57:21","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2523"},"modified":"2025-02-01T23:07:59","modified_gmt":"2025-02-01T23:07:59","slug":"remove-control-m-from-files","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/remove-control-m-from-files\/","title":{"rendered":"Remove Control ^M from files"},"content":{"rendered":"<p><strong>tpatil created the topic: Remove Control ^M from files<\/strong><\/p>\n<p>Single file method<\/p>\n<p><code>perl -pi -e \"s\/\\r\/\/\" filename.txt<\/code><\/p>\n<p>Multiple File Method<\/p>\n<p><code>find . -type f -exec perl -pi -e \"s\/\\r\/\/\" {} \\;<\/code><\/p>\n<p><strong>rajeshkumar replied the topic: Re:Remove Control ^M from files<\/strong><br \/>\nI used to do in shell using following command<\/p>\n<p>> 1,$s\/^M\/\/g<\/p>\n<p>Correct me if I am wrong<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <strong>twitter.com\/RajeshKumarIn<\/strong><\/p>\n<p><strong>tpatil replied the topic: Re:Remove Control ^M from files<\/strong><\/p>\n<p>Yes, this is also correct command if you want to remove ^M from single file in VI edit mode.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>tpatil created the topic: Remove Control ^M from files Single file method perl -pi -e &#8220;s\/\\r\/\/&#8221; filename.txt Multiple File Method find . -type f -exec perl -pi -e &#8220;s\/\\r\/\/&#8221; {} \\; 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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[14],"tags":[273],"class_list":["post-2523","post","type-post","status-publish","format-standard","hentry","category-perl","tag-files"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2523"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2523\/revisions"}],"predecessor-version":[{"id":2524,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2523\/revisions\/2524"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}