Line Terminations
April 13, 2006
Line terminations for different operating systems:
| unix | 0×0a | LF |
| Classic Mac | 0×0d | CR |
| Windows | 0×0d 0×0a | CR LF |
To convert a text file with DOS line termination to UNIX line termination:
tr -d '\015' < winfile.txt > unixfile.txt
or
sed s/.$// winfile.txt > unixfile.txt
To convert a unix file to a DOS file:
sed s/$/\x0d/ unixfile.txt > winfile.txt