DOS2UNIX的包装说明
该软件包包括DOS2UNIX的,unix2dos,mac2unix,unix2mac转换成文本文件的行结束UNIX(LF),DOS(CRLF)和Mac(CR)格式之间。 Windows和DOS下的文本文件通常具有两个ASCII字符的每一行的末尾:后跟LF(换行)CR(回车)。用老的Mac只是CR,而UNIX只使用LF。虽然大多数现代编辑器可以读取所有这些格式,仍可能需要在它们之间进行文件转换。这是典型的实用工具于1989年开发的。
- 作者:欧文Waterlander,基督教Wurll,贝恩德·约翰内斯Wuebben,本杰明·林
许可:FreeBSD的
0x01 包含在DOS2UNIX的包装工具
unix2dos - 从UNIX转换成DOS
:~# unix2dos -h unix2dos 6.0 (2012-05-06) Usage: unix2dos [options] [file ...] [-n infile outfile ...] -ascii convert only line breaks (default) -iso conversion between DOS and ISO-8859-1 character set -1252 Use Windows code page 1252 (Western European) -437 Use DOS code page 437 (US) (default) -850 Use DOS code page 850 (Western European) -860 Use DOS code page 860 (Portuguese) -863 Use DOS code page 863 (French Canadian) -865 Use DOS code page 865 (Nordic) -7 Convert 8 bit characters to 7 bit space -c, --convmode conversion mode convmode ascii, 7bit, iso, mac, default to ascii -f, --force force conversion of binary files -h, --help give this help -k, --keepdate keep output file date -L, --license display software license -l, --newline add additional newline -m, --add-bom add UTF-8 Byte Order Mark -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 -s, --safe skip binary files (default) -F, --follow-symlink follow symbolic links and convert the targets -R, --replace-symlink replace symbolic links with converted files (original target files remain unchanged) -S, --skip-symlink keep symbolic links and targets unchanged (default) -V, --version display version number
0x02 unix2mac - 转换从UNIX到Mac
:~# unix2mac -h unix2mac 6.0 (2012-05-06) Usage: unix2mac [options] [file ...] [-n infile outfile ...] -ascii convert only line breaks (default) -iso conversion between DOS and ISO-8859-1 character set -1252 Use Windows code page 1252 (Western European) -437 Use DOS code page 437 (US) (default) -850 Use DOS code page 850 (Western European) -860 Use DOS code page 860 (Portuguese) -863 Use DOS code page 863 (French Canadian) -865 Use DOS code page 865 (Nordic) -7 Convert 8 bit characters to 7 bit space -c, --convmode conversion mode convmode ascii, 7bit, iso, mac, default to ascii -f, --force force conversion of binary files -h, --help give this help -k, --keepdate keep output file date -L, --license display software license -l, --newline add additional newline -m, --add-bom add UTF-8 Byte Order Mark -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 -s, --safe skip binary files (default) -F, --follow-symlink follow symbolic links and convert the targets -R, --replace-symlink replace symbolic links with converted files (original target files remain unchanged) -S, --skip-symlink keep symbolic links and targets unchanged (default) -V, --version display version number
0x03 DOS2UNIX的 - 从DOS到UNIX转换
:~# dos2unix -h dos2unix 6.0 (2012-05-06) Usage: dos2unix [options] [file ...] [-n infile outfile ...] -ascii convert only line breaks (default) -iso conversion between DOS and ISO-8859-1 character set -1252 Use Windows code page 1252 (Western European) -437 Use DOS code page 437 (US) (default) -850 Use DOS code page 850 (Western European) -860 Use DOS code page 860 (Portuguese) -863 Use DOS code page 863 (French Canadian) -865 Use DOS code page 865 (Nordic) -7 Convert 8 bit characters to 7 bit space -c, --convmode conversion mode convmode ascii, 7bit, iso, mac, default to ascii -f, --force force conversion of binary files -h, --help give this help -k, --keepdate keep output file date -L, --license display software license -l, --newline add additional newline -m, --add-bom add UTF-8 Byte Order Mark -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 -s, --safe skip binary files (default) -F, --follow-symlink follow symbolic links and convert the targets -R, --replace-symlink replace symbolic links with converted files (original target files remain unchanged) -S, --skip-symlink keep symbolic links and targets unchanged (default) -V, --version display version number
0x04 mac2unix - 转换从Mac到UNIX
:~# mac2unix -h mac2unix 6.0 (2012-05-06) Usage: mac2unix [options] [file ...] [-n infile outfile ...] -ascii convert only line breaks (default) -iso conversion between DOS and ISO-8859-1 character set -1252 Use Windows code page 1252 (Western European) -437 Use DOS code page 437 (US) (default) -850 Use DOS code page 850 (Western European) -860 Use DOS code page 860 (Portuguese) -863 Use DOS code page 863 (French Canadian) -865 Use DOS code page 865 (Nordic) -7 Convert 8 bit characters to 7 bit space -c, --convmode conversion mode convmode ascii, 7bit, iso, mac, default to ascii -f, --force force conversion of binary files -h, --help give this help -k, --keepdate keep output file date -L, --license display software license -l, --newline add additional newline -m, --add-bom add UTF-8 Byte Order Mark -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 -s, --safe skip binary files (default) -F, --follow-symlink follow symbolic links and convert the targets -R, --replace-symlink replace symbolic links with converted files (original target files remain unchanged) -S, --skip-symlink keep symbolic links and targets unchanged (default) -V, --version display version number
0x05 unix2dos用法示例
:~# unix2dos -n unix.txt dos.txt unix2dos: converting file unix.txt to file dos.txt in DOS format ...
0x06 unix2mac用法示例
五
0x07 DOS2UNIX的用法示例
:~# dos2unix -n dos.txt unix2.txt dos2unix: converting file dos.txt to file unix2.txt in Unix format ...
0x08 mac2unix用法示例
:~# mac2unix -n mac.txt unix3.txt mac2unix: converting file mac.txt to file unix3.txt in Unix format ...
原文来自:https://www.hackfun.org/kali-tools/dos2unix_zh.html。转载请注明原出处,商用请联系原作者授权。