Quantcast
Channel: Emerson . – setaOffice
Viewing all articles
Browse latest Browse all 312

Remove ^M (Control-M) characters from a file in Unix

$
0
0

When checking my /etc/multipath.conf file, there was a lot of hidden characters ^M at the end of lines

root@linux:~ # cat -vet /etc/multipath.conf

To remove them, use tr and redirect the output to a new file.

root@linux:~ # tr -d ‘\015’ /tmp/multipath.conf

Check the file and if everything is okay, replace the original file


Filed under: Linux Tagged: cat, tr

Viewing all articles
Browse latest Browse all 312

Latest Images

Trending Articles



Latest Images