Carriage return and line feed (Re: [Techtalk] get rid of "^M" in a file)

Conor Daly conor.daly-linuxchix at cod.homelinux.org
Sat Jun 18 02:04:55 EST 2005


On Thu, Jun 16, 2005 at 03:25:11PM -0700 or so it is rumoured hereabouts, 
maria thought:
> So the files I have been looking at were actually created on a mac, and 
> seem to only have the ^M.  If I remove the ^M I just get one big glob of 
> text.

That's the other bit of the picture.  There are three ways to terminate
lines and each is used by one of Mac, MS and *NIX.  Mac uses carriage
return, *NIX uses line feed and MSDOS and successors uses both...
 
> Mary wrote:
> >
> >MS-DOS format text files have lines ending in two characters: carriage
> >return followed by line feed. (Some internet protocols including HTTP
> >follow this convention too.) UNIX format text files have lines ending in
> >one character, the line feed character. (According to [1] carriage
> >return takes the cursor all the way to the left, and line feed takes it
> >down a line. Line feed has both functions on UNIX.)

Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Hobbiton.cod.ie
 17:03:02  up 77 days,  1:19,  1 user,  load average: 0.00, 0.02, 0.00


More information about the Techtalk mailing list