dos2unix(1) 2024-01-22 dos2unix(1) dos2unix - DOS/ , dos2unix [<>] [<> ...] [-n <> <> ...] unix2dos [<>] [<> ...] [-n <> <> ...] dos2unix DOS , "dos2unix" "unix2dos" . DOS/ (CR) (LF) . (LF) . Mac OS X (CR) . Mac OS (LF) . dos2unix . DOS Latin-1 . (UTF-16) (UTF-8) . . FIFO . () . , . . dos2unix SunOS/ dos2unix . SunOS/ . SunOS/ ( ) , ( ) . "-o", "-n" . SunOS/ iso ascii . -- . . "-foo" , : dos2unix -- -foo : dos2unix -n -- -foo out.txt --allow-chown . . . "-o", "-n" . dos2unix . -ascii . . -iso DOS ISO-8859-1 . . -1252 1252() . -437 DOS 437() . ISO . -850 DOS 850() . -860 DOS 860() . -863 DOS 863( ) . -865 DOS 865() . -7 8 7 . -b, --keep-bom (BOM) . BOM , BOM . DOS . "-r" . -c, --convmode <> . <> ascii, 7bit, iso, mac ascii . -D, --display-enc <> . <> ansi, unicode, unicodebom, utf8, utf8bom , ansi . dos2unix . , . . . ansi dos2unix ANSI . . . dos2unix "chcp" ANSI DOS OEM . ANSI . . . unicode, unicodebom (UTF-16 ) . . . , . ConEmu ConEmu . . . "unicodebom" BOM( ) . BOM . utf8, utf8bom utf8 . . "unicode" . . . . ConEmu utf8 . "utf8bom" UTF-8 BOM( ) . BOM . DOS2UNIX_DISPLAY_ENC "unicode", "unicodebom", "utf8", "utf8bom" . -e, --add-eol . . DOS . . POSIX , . , . -f, --force . -gb, --gb18030 UTF-16 UTF-8 . UTF-16 GB18030 . . GB18030 . -h, --help . -i[<>], --info[=<>] <> ... . . DOS , , , , , . : 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe . "-s" . "-e" "--add-eol" , "noeol" . : 6 0 0 no_bom text dos dos.txt 0 6 0 no_bom text unix unix.txt 0 0 6 no_bom text mac mac.txt 1 0 0 no_bom text noeol noeol_dos.txt . . 0 . c . xargs(1) "-0" "--null" . d DOS . u . m . b . t . e , "noeol" . c . dos2unix "c" DOS . unix2dos . "-e" "--add-eol" . h . p . : *.txt : dos2unix -i *.txt DOS : dos2unix -idu *.txt : dos2unix --info=b *.txt DOS : dos2unix -ic *.txt : unix2dos -ic *.txt DOS : dos2unix -e -ic *.txt DOS : dos2unix -ic0 *.txt | xargs -0 dos2unix DOS : find -name '*.txt' -print0 | xargs -0 dos2unix -ic -k, --keepdate . -L, --license . -l, --newline . dos2unix: DOS . . unix2dos: DOS . . -m, --add-bom (BOM) . UTF-8 BOM . UTF-16 "-u" UTF-16 BOM . UTF-8, UTF-16, GB18030 . . -n, --newfile <> <> ... . <> <> . , . () . / umask(1) . --no-allow-chown (). . "-o", "-n" . dos2unix . --no-add-eol . -O, --to-stdout . () "-o" . "-e" . , . : dos2unix -e -O file1.txt file2.txt > output.txt -o, --oldfile <> ... . <> <> . . . ( ) , , . ( , root) . . . . , , / . dos2unix "dos2unix -V" . . , . . , . , . "--allow-chown" : dos2unix --allow-chown foo.txt : dos2unix -n foo.txt foo.txt "--allow-chown" , . -q, --quiet . . 0. . -r, --remove-bom (BOM) . BOM . . "-b" . -s, --safe (). . 100% . . . () . -u, --keep-utf16 UTF-16 . UTF-16 . UTF-8 . UTF-16 BOM . "-ascii" . -ul, --assume-utf16le UTF-16LE . BOM . ( UTF-16LE ) , UTF-8 . iconf(1) UTF-8 UTF-16LE . . UTF-16LE . ascii UTF-16LE . -ub, --assume-utf16be UTF-16BE . "-ul" . -v, --verbose . , . -F, --follow-symlink . -R, --replace-symlink ( ). -S, --skip-symlink (). -V, --version . DOS . . , . DOS . "-c mac" "mac2unix" "unix2mac" . ascii . UTF-8 . ascii 7bit iso . dos2unix UTF-16 UTF-16 POSIX UTF-8 . ascii UTF-16 ("u") UTF-16 ("-ul" "-ub") . dos2unix UTF-16 "dos2unix -V" . . 7bit (128~255 ) 8 7 . iso DOS ( ) ISO ISO-8859-1(Latin1) . ISO-8859-1 DOS . ISO-8859-1 DOS . dos2unix "-iso" . dos2unix CP437 . "-437" (US), "-850" (), "-860" (), "-863" ( ), "-865" () . CP1252 () "-1252" . dos2unix iconv(1) . iconv . ISO . UTF-8 . : DOS Latin-1 : dos2unix -iso -n in.txt out.txt DOS CP850 Latin-1 : dos2unix -850 -n in.txt out.txt CP1252 Latin-1 : dos2unix -1252 -n in.txt out.txt CP1252 UTF-8() : iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Latin-1 DOS : unix2dos -iso -n in.txt out.txt Latin-1 DOS CP850 : unix2dos -850 -n in.txt out.txt Latin-1 CP1252 : unix2dos -1252 -n in.txt out.txt UTF-8() CP1252 : unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt . . UTF-8 . UTF-8, UTF-16, UTF-16 UTF-16 . DOS, , . dos2unix unix2dos UTF-8 UTF-8 . UTF-16 dos2unix unix2dos UTF-16 . dos2unix UTF-16 "dos2unix -V" . / UTF-16 . locale(1) . , . UTF-16 UTF-8 . UTF-8 , , . UTF-16 UTF-8 , . UTF-16 UTF-8 , UTF-16 , . "-u" UTF-16 . "-u" UTF-8 . dos2unix unix2dos UTF-8 UTF-16 . ISO 7 UTF-16 . (BOM) ( ) BOM (BOM) . . BOM . . dos2unix UTF-16 , BOM . UTF-16 BOM dos2unix . UTF-16 BOM "-ul" "-ub" . dos2unix BOM . BOM dos2unix "-b" BOM . unix2dos BOM BOM . BOM "-r" . dos2unix unix2dos "-m" BOM . dos2unix . dos2unix ANSI . dos2unix "dos2unix -V" . . "-D", "--display-enc" . () . UTF-16(+BOM) UTF-8 : dos2unix -n in.txt out.txt UTF-16LE(-BOM) UTF-8 : dos2unix -ul -n in.txt out.txt UTF-8 UTF-8(+BOM) : unix2dos -m -n in.txt out.txt UTF-8 UTF-16 : unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt GB18030 GB18030 . GB18030 . . GB18030 , . UTF-8 , GB18030 . GB18030 GBK 936 . / UTF-16 GB18030 GB18030 . . "locale -a" . UTF-16 GB18030 "-gb" . GB18030 . ' ' ' ' : dos2unix < a.txt cat a.txt | dos2unix a.txt . b.txt : dos2unix a.txt b.txt dos2unix -o a.txt b.txt a.txt : dos2unix a.txt a.txt , b.txt 7 : dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt a.txt : dos2unix -c mac a.txt mac2unix a.txt a.txt : unix2dos -c mac a.txt unix2mac a.txt a.txt : dos2unix -k a.txt dos2unix -k -o a.txt a.txt e.txt : dos2unix -n a.txt e.txt a.txt e.txt , e.txt a.txt : dos2unix -k -n a.txt e.txt a.txt , b.txt e.txt : dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt a.txt e.txt , a.txt , b.txt , d.txt f.txt : dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt dos2unix , find(1) xargs(1) . .txt : find . -name '*.txt' -print0 |xargs -0 dos2unix find(1) "-print0" xargs(1) "-0" . . find(1) "-exec" : find . -name '*.txt' -exec dos2unix {} \; : for /R %G in (*.txt) do dos2unix "%G" : get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LANG LANG . LANG . . . . . POSIX : export LANG=nl Dutch export LANG=nl_NL Dutch, The Netherlands export LANG=nl_BE Dutch, Belgium export LANG=es_ES Spanish, Spain export LANG=es_MX Spanish, Mexico export LANG=en_US.iso88591 English, USA, Latin-1 encoding export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding gettext locale(1) . LANGUAGE LANGUAGE . dos2unix LANGUAGE LANG . "LANGUAGE=nl:de"() . LANGUAGE LANG "C" . gettext () . DOS2UNIX_LOCALEDIR DOS2UNIX_LOCALEDIR , LOCALEDIR . LOCALEDIR . GNU "/usr/local/share/locale". --version LOCALEDIR . (POSIX ): export DOS2UNIX_LOCALEDIR=$HOME/share/locale 0 . . 1 . 0, . Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer) : SourceForge : file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix 2024-01-22 dos2unix(1)