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 can be used to convert from Unix to DOS. This tool comes in handy when sharing files between Windows and Linux machines.
emerge --ask app-text/dos2unix
To convert a file that has DOS line endings to Unix format:
dos2unix: converting file my_file.txt to Unix format...
To convert a file that has Unix line endings to DOS format:
unix2dos: converting file my_file.txt to DOS format...
- man dos2unix