summaryrefslogtreecommitdiff
path: root/man/man1/dos2unix.txt
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-20 13:30:01 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-20 13:30:04 +0900
commitff02b77ca132c1ed60c503dceda5305738128bf2 (patch)
treea96ffc97fc12318d39f0883c9303a5d0324385b5 /man/man1/dos2unix.txt
parent844262890797f165a0497afdcc1ad8f5caec971d (diff)
downloaddos2unix-ff02b77ca132c1ed60c503dceda5305738128bf2.tar.gz
dos2unix-ff02b77ca132c1ed60c503dceda5305738128bf2.tar.bz2
dos2unix-ff02b77ca132c1ed60c503dceda5305738128bf2.zip
Imported Upstream version 7.3.3
Change-Id: I19b8eba9412d6377bfa3daa54e965fbed99940b2 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'man/man1/dos2unix.txt')
-rw-r--r--man/man1/dos2unix.txt50
1 files changed, 39 insertions, 11 deletions
diff --git a/man/man1/dos2unix.txt b/man/man1/dos2unix.txt
index 3c07750..3ce9952 100644
--- a/man/man1/dos2unix.txt
+++ b/man/man1/dos2unix.txt
@@ -35,7 +35,9 @@ DESCRIPTION
important difference with the original SunOS/Solaris version. This
version does by default in-place conversion (old file mode), while the
original SunOS/Solaris version only supports paired conversion (new file
- mode). See also options "-o" and "-n".
+ mode). See also options "-o" and "-n". Another difference is that the
+ SunOS/Solaris version uses by default *iso* mode conversion while this
+ version uses by default *ascii* mode conversion.
OPTIONS
-- Treat all following options as file names. Use this option if you
@@ -87,7 +89,8 @@ OPTIONS
-D, --display-enc ENCODING
Set encoding of displayed text. Where ENCODING is one of: *ansi*,
- *unicode*, *utf8* with ansi being the default.
+ *unicode*, *unicodebom*, *utf8*, *utf8bom* with ansi being the
+ default.
This option is only available in dos2unix for Windows with Unicode
file name support. This option has no effect on the actual file
@@ -111,7 +114,7 @@ OPTIONS
symbol instead. When you don't work with foreign file names this
method is OK.
- unicode
+ unicode, unicodebom
The advantage of unicode (the Windows name for UTF-16) encoding
is that text is usually properly displayed. There is no need to
change the active code page. You may need to set the console's
@@ -125,12 +128,14 @@ OPTIONS
The disadvantage of unicode is that it is not compatible with
ASCII. The output is not easy to handle when you redirect it to
- another program or a file. Redirection to a file does not give a
- correct UTF-16 file.
+ another program.
- utf8
- The advantage of utf8 is that it is compatible with ASCII and
- when you redirect it to a file you get a proper UTF-8 file. You
+ When method "unicodebom" is used the Unicode text will be
+ preceded with a BOM (Byte Order Mark). A BOM is required for
+ correct redirection or piping in PowerShell.
+
+ utf8, utf8bom
+ The advantage of utf8 is that it is compatible with ASCII. You
need to set the console's font to a TrueType font. With a
TrueType font the text is displayed similar as with the
"unicode" encoding.
@@ -143,8 +148,13 @@ OPTIONS
In a ConEmu console the utf8 encoding method works well.
+ When method "utf8bom" is used the UTF-8 text will be preceded
+ with a BOM (Byte Order Mark). A BOM is required for correct
+ redirection or piping in PowerShell.
+
The default encoding can be changed with environment variable
- DOS2UNIX_DISPLAY_ENC by setting it to "unicode" or "utf8".
+ DOS2UNIX_DISPLAY_ENC by setting it to "unicode", "unicodebom",
+ "utf8", or "utf8bom".
-f, --force
Force conversion of binary files.
@@ -176,6 +186,9 @@ OPTIONS
50 0 0 UTF-8 text utf8dos.txt
2 418 219 no_bom binary dos2unix.exe
+ Note that sometimes a binary file can be mistaken for a text file.
+ See also option "-s".
+
Optionally extra flags can be set to change the output. One or more
flags can be added.
@@ -195,6 +208,10 @@ OPTIONS
contain DOS line breaks, unix2dos will print only file names
that have Unix line breaks.
+ h Print a header.
+
+ p Show file names without path.
+
Examples:
Show information for all *.txt files:
@@ -288,6 +305,13 @@ OPTIONS
-s, --safe
Skip binary files (default).
+ The skipping of binary files is done to avoid accidental mistakes.
+ Be aware that the detection of binary files is not 100% foolproof.
+ Input files are scanned for binary symbols which are typically not
+ found in text files. It is possible that a binary file contains only
+ normal text characters. Such a binary file will mistakenly be seen
+ as a text file.
+
-u, --keep-utf16
Keep the original UTF-16 encoding of the input file. The output file
will be written in the same UTF-16 encoding, little or big endian,
@@ -525,8 +549,8 @@ GB18030
EXAMPLES
Read input from 'stdin' and write output to 'stdout':
- dos2unix
- dos2unix -l -c mac
+ dos2unix < a.txt
+ cat a.txt | dos2unix
Convert and replace a.txt. Convert and replace b.txt:
@@ -590,6 +614,10 @@ RECURSIVE CONVERSION
for /R %G in (*.txt) do dos2unix "%G"
+ PowerShell users can use the following command in Windows PowerShell:
+
+ get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}
+
LOCALIZATION
LANG
The primary language is selected with the environment variable LANG.