Under Solaris, you have these nice utilities: dos2unix and unix2dos. But, they doesn't exists under Linux.

You can obtain the same result using awk :

  • DOS to UNIX:

awk '{ sub("\r$", ""); print }' dosfile.txt > unixfile.txt

  • UNIX to DOS:

awk 'sub("$", "\r")' unixfile.txt > dosfile.txt