`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.


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.


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