Linux – How to convert line breaks in a text file between the Windows and Unix/Linux formats

linuxunixwindows

How do I convert line breaks in a text file between the Windows and Unix/Linux formats?

I have a *nix environment, but that I need to import and export data with the Windows-style line breaks. I thought there would be a standard utility or command to do this, but I can't seem to find it.

Best Answer

You're probably looking for dos2unix, unix2dos, todos or fromdos depending on your distribution. Ubuntu/Debian package todos/fromdos as part of the tofrodos package from memory.