dos2unix(1) 2024-01-22 dos2unix(1) dos2unix - DOS/Mac Unix, dos2unix [] [ ...] [-n _ _ ...] unix2dos [] [ ...] [-n _ _ ...] Dos2unix "dos2unix" "unix2dos", DOS Mac Unix, . DOS/Windows : (CR) (LF). Unix : (LF). Mac, Mac OS X, : (CR). Mac OS Unix (LF). , Dos2unix . DOS Latin-1 Unix. Windows Unicode (UTF-16) Unix Unicode (UTF-8). , . , , FIFO. , ' . , - . Windows ' . dos2unix dos2unix SunOS/Solaris. , SunOS/Solaris. ( ), SunOS/Solaris ( ). . "-o" "-n". , SunOS/Solaris iso, ascii. -- . , , . , <<-foo>>, : dos2unix -- -foo : dos2unix -n -- -foo out.txt --allow-chown . , , / . , , , . . "-o" "-n". , dos2unix . -ascii . . . -iso DOS ISO-8859-1. . . -1252 1252 Windows ( ). -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 Windows Unicode. , , . Windows, . . ansi dos2unix ANSI. . TrueType. , , DOS OEM ANSI Windows "chcp", dos2unix Windows. ansi , , , . . , , . unicode, unicodebom unicode ( Windows UTF-16) , . . , TrueType . TrueType, , . ConEmu, , ConEmu . unicode , ASCII. , . "unicodebom", Unicode BOM ( ). BOM PowerShell. utf8, utf8bom utf8 , ASCII. TrueType. TrueType, , , "unicode". , , ASCII . unicode, . Windows, - , . ConEmu utf8. "utf8bom", UTF-8 BOM ( ). BOM PowerShell. DOS2UNIX_DISPLAY_ENC "unicode", "unicodebom", "utf8" "utf8bom". -e, --add-eol , . - . , DOS Unix . , . Unix , POSIX . , ' . -f, --force . -gb, --gb18030 Windows UTF-16 UTF-8, . UTF-16 GB18030. Windows. . , GB18030. -h, --help . -i[], --info[=] ... . . , : DOS, Unix, Mac, , . : 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 , . , , <>. "-0" "--null" xargs(1). d DOS. u Unix. m Mac. b . t , . e "noeol", . c , . "c" dos2unix , DOS. unix2dos , Unix. "-e" "--add-eol", , . h . p . : *.txt: dos2unix -i *.txt DOS Unix: dos2unix -idu *.txt : dos2unix --info=b *.txt , DOS: dos2unix -ic *.txt , Unix: 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: Unix DOS. Mac Unix Mac. unix2dos: DOS DOS. Mac Mac Unix. -m, --add-bom (BOM). UTF-8. UTF-16 "-u", UTF-16. , UTF-8, UTF-16 GB18030. . UNICODE. -n, --newfile _ _ ... . _ _. , , . , ( ). umask(1) , . --no-allow-chown ( ). , / . . "-o" "-n". , dos2unix . --no-add-eol , . -O, --to-stdout , Unix. "-o", ( ). "-e" . ' ' Unicode. : dos2unix -e -O 1.txt 2.txt > .txt -o, --oldfile ... . . , . . ( ) , . , , ( root), , . . , , . Unix. , dos2unix , "dos2unix -V". . , , . , . , , , . , / . "--allow-chown", : dos2unix --allow-chown .txt : dos2unix -n .txt .txt "--allow-chown" , -, , . -q, --quiet . . , . -r, --remove-bom (BOM). BOM . Unix. . "-b". -s, --safe (). , . , 100% . , . , . . -u, --keep-utf16 UTF-16. UTF-16, , . UTF-8. UTF-16. "-ascii". -ul, --assume-utf16le , UTF-16LE. (BOM), -, . ( UTF-16LE), , UTF-8 . iconv(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 . MAC , DOS Unix, . Mac . Mac Mac Unix, . DOS . Mac, "-c mac" "mac2unix" "unix2mac". ascii . ASCII ASCII , UTF-8. ascii 7bit iso. dos2unix UTF-16, UTF-16 POSIX UTF-8 Windows. ascii UTF-16 ("-u") , , UTF-16 ("-ul" "-ub"). , dos2unix UTF-16, "dos2unix -V". . UNICODE. 7bit 8- , ASCII, ( 128 255) 7- . iso ( ) DOS ISO-8859-1 (Latin-1) Unix. DOS, ISO-8859-1 , . ISO-8859-1, DOS. "-iso", dos2unix . , dos2unix CP437, . , "-437" (), "-850" ( ), "-860" (), "-863" ( ) "-865" ( ). Windows CP1252 ( ) "-1252". dos2unix iconv(1). iconv . ISO Unicode. UTF-8. : DOS Latin-1 Unix: dos2unix -iso -n in.txt out.txt DOS CP850 Latin-1 Unix: dos2unix -850 -n in.txt out.txt CP1252 Windows Latin-1 Unix: dos2unix -1252 -n in.txt out.txt CP252 Windows UTF-8 Unix (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Latin-1 Unix DOS: unix2dos -iso -n in.txt out.txt Latin-1 Unix DOS CP850: unix2dos -850 -n in.txt out.txt Latin-1 Unix Windows CP1252: unix2dos -1252 -n in.txt out.txt UTF-8 Unix (Unicode) Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt . . UNICODE Unicode. Unix Linux Unicode UTF-8. Windows Unicode UTF-8, UTF-16 UTF-16 . , , UTF-16. Unicode, ASCII, DOS, Unix Mac. dos2unix unix2dos UTF-8, UTF-8 , ASCII . dos2unix unix2dos, Unicode UTF-16, UTF-16 . , dos2unix UTF-16, "dos2unix -V". Unix/Linux UTF-16 . locale(1). , . Windows UTF-16 UTF-8. , Windows Unix/Linux, UTF-8. UTF-16 UTF-8 . . UTF-16 UTF-8 , , UTF-16 , . "-u", UTF-16, . Option "-u" UTF-8. dos2unix unix2dos UTF-8 UTF-16. ISO 7- UTF-16. Windows Unicode (BOM), Windows ( Notepad) . . . Unix Unicode . , , . dos2unix , UTF-16, . , UTF-16, , dos2unix (). UTF-16 "-ul" "-ub". dos2unix (BOM). "-b", dos2unix BOM, BOM . unix2dos (BOM) , BOM . "-r", BOM. Dos2unix unix2dos (BOM), "-m". Unicode Windows dos2unix Unicode Windows. , dos2unix , , ANSI. , dos2unix Windows Unicode, "dos2unix -V". Unicode Windows ' . . "-D", "--display-enc". , . Unicode Windows UTF-16 ( (BOM)) Unix UTF-8: dos2unix -n in.txt out.txt Windows UTF-16LE ( BOM) UTF-8 Unix: dos2unix -ul -n in.txt out.txt UTF-8 Unix Windows UTF-8 BOM: unix2dos -m -n in.txt out.txt UTF-8 Unix Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt GB18030 GB18030 . ' GB18030 - , . . . GB18030 Unicode. unicode. UTF-8, GB18030 ASCII. GB18030 Windows 936, GBK. Unix/Linux UTF-16 GB18030, GB18030. , , . , "locale -a". Windows UTF-16 GB18030 "-gb". GB18030 , , Unicode. (stdin) (stdout): dos2unix < a.txt cat a.txt | dos2unix a.txt . b.txt : dos2unix a.txt b.txt dos2unix -o a.txt b.txt a.txt ascii: dos2unix a.txt a.txt ascii. 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 Mac Unix: dos2unix -c mac a.txt mac2unix a.txt a.txt Unix Mac: 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. a.txt e.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 c.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 UNIX find(1) xargs(1) dos2unix . , .txt , : find . -name '*.txt' -print0 |xargs -0 dos2unix find(1) "-print0" xargs(1) "-0" , . , . find(1) "-exec": find . -name '*.txt' -exec dos2unix {} \; Windows : for /R %G in (*.txt) do dos2unix "%G" PowerShell Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LANG LANG. LANG . . ', , . ' : . . POSIX: export LANG=uk export LANG=uk_UA , export LANG=ru_UA , export LANG=es_ES , export LANG=es_MX , export LANG=en_US.iso88591 , , Latin-1 export LANG=en_GB.UTF-8 , , UTF-8 gettext: Unix locale(1). LANGUAGE LANGUAGE . . dos2unix LANGUAGE LANG. , , : "LANGUAGE=nl:de". , LANG ( LC_ALL) , <>. LANGUAGE. gettext: , , . DOS2UNIX_LOCALEDIR LOCALEDIR, , DOS2UNIX_LOCALEDIR. LOCALEDIR . GNU "/usr/local/share/locale". LOCALEDIR --version. ( POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale , . , . , 1. , . Benjamin Lin - , Bernd Johannes Wuebben ( mac2unix) - , Christian Wurll ( ) - , Erwin Waterlander - () : SourceForge: file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix 2024-01-22 dos2unix(1)