# fromdos(1) - man - phpMan

[tofrodos(1)](https://www.chedong.com/phpMan.php/man/tofrodos/1/markdown)                            General Commands Manual                           [tofrodos(1)](https://www.chedong.com/phpMan.php/man/tofrodos/1/markdown)



## NAME
       tofrodos - Converts text files between DOS and Unix formats.

## SYNOPSIS
       **fromdos** [ _options_ ] [file...]
       **todos** [ _options_ ] [file...]

## DESCRIPTION
       DOS  text files traditionally have carriage return and line feed pairs as their newline char‐
       acters while Unix text files have the line feed as their newline character.  _fromdos_ converts
       ASCII  and  Unicode UTF-8 text files from the DOS format to the Unix format, while _todos_ con‐
       verts them from the Unix format to the DOS format.

       The programs accept multiple filenames and wildcards as their arguments.  You  may  also  use
       them  in  a  pipe.   If  either program finds its input redirected, it will process stdin and
       place the output on stdout.

## OPTIONS
### -a
              fault,  Tofrodos does the expected thing for text files. That is, when converting from
              DOS to Unix, it will remove carriage returns only if they are followed by line  feeds.
              When  converting  from Unix to DOS, it will add carriage returns only if the linefeeds
              are not already preceeded by carriage returns. When Tofrodos is run on a  normal  text
              file  that  has  already been converted, the resulting file should be identical to the
              original. However, if you use this option, the program will always remove carriage re‐
              turns  in the DOS to Unix mode and always add carriage returns in the Unix to DOS mode
              even if it is not appropriate.

### -b
              the  original  filename, silently replacing any existing file of that name.  For exam‐
              ple, a file called "filename.ext" becomes "filename.ext.bak"  replacing  any  existing
              file  having  the name "filename.ext.bak".  Important: the program behaves differently
              if it is compiled for DOS (as compared to being compiled for Windows, Linux, Mac OS  X
              or  other  systems). In view of the filename restrictions present on DOS, the DOS exe‐
              cutable will strip the original file extension, if any, from the file before appending
              the _.bak_ extension. For example, "filename.ext" becomes "filename.bak".

### -d
              direction. By default, if the program is named _fromdos_ or  _dos2unix,_  it  will  assume
              that the input file is in a DOS format and convert it to a Unix format. If the program
              is named _todos_ or _unix2dos,_ it will assume that the input file is in a Unix format and
              convert  it  to a DOS format. Using the _-d_ option forces the program to convert from a
              DOS format to a Unix format regardless of how the program is  named.  Likewise,  using
              the _-u_ option forces the program to convert from a Unix format to a DOS format regard‐
              less of the name of the program.

### -e
              process  the  next file on the command line when it encounters any errors. This option
              causes it to abort on errors.

### -f
              gram  finds  that  the  file  does not have write permission, it will not process that
              file. This option forces the conversion even if the file is read-only.

### -h

### -l
              Log error messages to <logfile>. Note that if your command line has an error, such  as
              when  you specify an unknown option, the error message for the command line option er‐
              ror will be issued to stderr instead and not logged.

### -o

### -p
              DOS,  it  only preserves the file time. Note that on many Unix-type systems, including
              Linux, the file ownership will only be preserved if the program is run as root, other‐
              wise it will just set the file time and silently fail the change of file ownership. On
              such systems, if you want a warning message when the file ownership cannot be changed,
              use -v (the verbose flag) as well.

### -u

### -v

### -V

## EXIT CODE
       Tofrodos terminates with an exit code of 0 on success and 1 on error.

       If  the  program is invoked with multiple files on the command line, the default behaviour is
       to skip to the next file in the list if an error is encountered with  any  file.  In  such  a
       case,  the exit code returned will the status of the last file processed (ie, 0 on success, 1
       on failure). If this is not desirable, use the -e option, which will  force  the  program  to
       abort immediately with the appropriate exit code on encountering any error.

## AUTHOR
       The  program  and  its  documentation  are copyrighted (c) 1996-2013 by Christopher Heng. All
       rights reserved. They are distributed under the terms of the GNU General Public License  Ver‐
       sion 2.

       The latest version of tofrodos can be obtained from
       <http://www.thefreecountry.com/tofrodos/index.shtml>



2013                                       Version 1.7.13                                [tofrodos(1)](https://www.chedong.com/phpMan.php/man/tofrodos/1/markdown)
