Dos2unix

dos2unix is a tool to convert text files from DOS line endings (carriage return + line feed) to Unix line endings (line feed). It is also capable of conversion between UTF-16 to UTF-8. Invoking the unix2dos command it can be used to convert from Unix to DOS. This tool comes in handy when sharing files between Windows and Linux machines.

Usage
To convert a file that has DOS line endings to Unix format, run:

To convert a file that has Unix line endings to DOS format, run:

External resources
The dos2unix SourceForge page.