How Do I Remove Ctrl M Characters from Unix?
Contents

How do I get rid of M in vi?

How I was able to remove it in vi editor: After :%s/ then press ctrl + V then ctrl + M . This will give you ^M. Then //g (will look like: :%s/^M ) press Enter should get all removed.

How do I find Control M characters in Unix?

Note: Remember how to type control M characters in UNIX, just hold the control key and then press v and m to get the control-m character.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest