`dos2unix -b` doesn't create a backup file with .bak extension

To make a backup of original file. The original file is renamed with the original filename and a .bak extension. Type the following command:

$ dos2unix -b myfile.txt

The -b option, however, is for keeping the byte order mark (BOM), not making a backup.

1 Like

Hi @robin217

Thank you for the feedback. You are right. The page has been updated.

Best,

1 Like

Apparently, some distributions implemented unix2dos as a symlink to todos, which does have a -b option for backup. So that probably explains it.

http://www.microhowto.info/howto/convert_the_line_endings_in_a_text_file_from_unix_to_dos_format.html

Be aware that some systems (notably Debian prior to Squeeze and Ubuntu prior to Maverick) implement unix2dos as a softlink to todos.


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki