Three versions of the dos2unix program, which converts line endings
between the DOS-style CRLF and Unix-style LF.
Ubuntu Linux:
========================================================================
$ dos2unix -h
tofrodos Ver 1.7.8 Converts text files between DOS and Unix formats.
Copyright 1996-2008 by Christopher Heng. All rights reserved.
Usage: dos2unix [options] [file...]
-a Always convert (DOS to Unix: kill all CRs;
Unix to DOS: convert all LFs to CRLFs)
-b Make backup of original file (.bak).
-d Convert DOS to Unix.
-e Abort processing files on error in any file.
-f Force: convert even if file is not writeable.
-h Display help on usage and quit.
-l file Log most errors and verbose messages to <file>
-o Overwrite original file (no backup).
-p Preserve file owner and time.
-u Convert Unix to DOS.
-v Verbose.
-V Show version and quit.
Arch Linux:
========================================================================
$ dos2unix -h
usage:
dos2unix [--verbose|-v] [--test|-t] [--force|-f] \
[--<x>2<y>|--auto|-<Z>] \
[<file name> [...]]
where:
--auto, -A output will be set based upon auto-detection
of source format
--d2u, -U perform DOS -> UNIX conversion
--m2u, -T perform MAC -> UNIX conversion
--u2d, -D perform UNIX -> DOS conversion
--u2m, -M perform UNIX -> MAC conversion
--d2m, -O perform DOS -> MAC conversion
--m2d, -C perform MAC -> DOS conversion
--force suppress internal conversion type corrections
based on autodetected input format
--skipbin, -b skip binary files
--test, -t don't write any conversion results; useful with
--verbose to just report on source type
--verbose, -v print extra information on stderr
--version, -V print version information on stderr
- when no options are given then input format will be automatically detected
and converted as follows:
DOS -> UNIX
MAC -> UNIX
UNIX -> DOS
- same as above applies if --auto option is used
- when no file is given, then stdin is used as input and stdout as output
- binary files will be skipped automatically if option --skipbin
(or -b) is used
- stray '\r' characters (without a following '\n') in files in DOS format are
reported but only conversion 'DOS -> Unix' affects them (they are skipped)
- stray '\n' characters in files in MAC format are not detected for now
Mac OSX (FreeBSD):
========================================================================
dos2unix 5.1.1 (2010-08-18)
Usage: dos2unix [-fhkLlqV] [-c convmode] [-o file ...] [-n infile outfile ...]
-c --convmode conversion mode
convmode ascii, 7bit, iso, mac, default to ascii
-f --force force conversion of all files
-h --help give this help
-k --keepdate keep output file date
-L --license display software license
-l --newline add additional newline
-n --newfile write to new file
infile original file in new file mode
outfile output file in new file mode
-o --oldfile write to old file
file ... files to convert in old file mode
-q --quiet quiet mode, suppress all warnings
always on in stdio mode
-V --version display version number