How to remove ^M character

Munden, Randall J Randall.Munden at
Mon Aug 4 08:14:56 PDT 2003

Or, if you've perl available:

perl -pi -e 's/\r\n/\n/;' [file name]

-----Original Message-----
From: C Peter Biessener [mailto:pbiessener at] 
Sent: Monday, August 04, 2003 10:09 AM
To: freebsd-questions at
Subject: Re: How to remove ^M character

You can also use ASCII mode in ftp, it will translate the line ends for 
you.  BINARY mode is for programs and archive files (zip, tar, tgz,

Simon Barner wrote:
> Hi,
>>I ftp'd a file from windows to freebsd....not its every line has ^M at

>>its end. Is there some command in vi (or some way) by whcih ^M can be 
> You can use dos2unix(1) for that. There is also the complementary tool

> unix2dos(1).
> Simon

freebsd-questions at mailing list
To unsubscribe, send any mail to
"freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list