unix2dos — Convert Unix Text Files to Windows Format

unix2dos converts a Unix/Linux text file to Windows-style line endings. It is mainly useful when a file needs to be opened by older Windows tools that expect CRLF line endings.

Convert a file

unix2dos notes.txt

This updates the file in place. Make a copy first if you need to keep the original Unix-format file.

cp notes.txt notes-unix.txt
unix2dos notes.txt

For shell scripts and Linux configuration files, keep Unix line endings and use dos2unix instead if needed.

Leave a Comment