XXD 1 "August 1996" "�������� man ��� xxd"

21st May 1996
Man page author:
Tony Nugent <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
Changes by Bram Moolenaar <Bram@vim.org>
���
xxd - ������� ������������� ����� � ���� ����������������� ����� ��� ��������� �������� ��������������.
��������� ������
xxd -h[elp]

xxd [�����] [�������_���� [��������_����]]

xxd -r[evert] [�����] [�������_���� [��������_����]]

��������
xxd ������� ������������� ���������� ����� ��� ������, ����������� �� ������ ������������ �����, � ���� ����������������� �����. ��� ������� ����� ����� ��������� �������� �������������� �������� ������������������ ������ ������ � �������� �������� ������. ������� �������� uuencode(1) uudecode(1), ��� ��������� ��������� �������������� �������� ������ � ASCII-���, ������� ����� ���������� �� ����������� �����, ������, ������ �����, ��������� xxd ��������� ��������� ������������� � ����� ������������ ������, � ����� ����� ����������� ��� �������� �������� ��� �������� ������.
����� �������
���� �������_���� �� �����, �� ��������������� ������ �������� �� ������ ������������ �����. � ������, ���� � �������� ��������_����� ������������ ������ \` - ', ���������� ������ ����� ��������� ����� ������������ �����. � ��� ������, ���� �� ������ ��������_���� (��� ������ ���� ������������ ������ \` - ' ), ��������� �������������� ������������ � ����� ������������ ������.

�������� ��������, ��� ������������ "�������" �������� ������� ������, ������� �� ��������� ����� ����� ����� �����, ���� � ���� ����� �� ������������ ��������. ������� ����� ������������ �������� ����� � ��������������� ���������� �� �������� �������������. ��������� ������ ����� ���� ������ � �������������� �����������, ������������������ ��� ������������� �������. ����� �������, ����� -c8 , "-c 8" , -c 010 -cols 8 �������� �������������.

-a " | " -autoskip �������� �������������� �������: ������ ������������������ ������� ����� ������������ ��������� ������ '*'. �� ��������� �� �����������.

-b " | " -bits ������ ������������������ ���� ������������ ���� (�������� �����). ��� ������������� ����� ����� ������ �������� ������������������ ������������� ������� ������������ ������ �� ������ �������� "1" � "0". ������ ������ ������������ ������� ������ � ����������������� ����, � ����������� ���������� �������������� (� ���� ascii ��� ebcdic). ����� -r, -p, -i � ���� ������ �� ��������.

"-c ��� " | " -cols ���" ������ ���������� ������� < ��� >, ������� ��������� �� ������ ������. �� ��������� ������������ �������� 16 (-i: 12, -ps: 30, -b: 6). ����������� ���������� ��������: 256.

-E " | " -EBCDIC �������� ������ ����������� �������� � ������ ������� � ASCII �� EBCDIC. ���� ���� �� �������� ����������������� �������������. ������ ���� �� ����� ������, ���� ������������ ����� -r, -p ��� -i.

"-g ���� " | " -groupsize ����" ��������� ��������� ����������� ���������� ���������� < ������ > (��� ����������������� ����� ��� ������ �����), ������� ������ ���� �� ����� ���������. �������� -g 0 ����������� ��� ������ �� ������������� �����������. �� ��������� ������������ �������� < ���� "> ������ " 2 � ������� ������ � 1 � ������� ������. ����������� �� ����������� � ������� postscript � include.

-h " | " -help ������� ������� �� ��������� ������ ��������� ������ � ��������� ������ ���������. �������� ������������������ ������������� �� �����������.

-i " | " -include ��������� ��������� ����� � ����� ������������ ������������ ������ ����� C. ����� �������� ����������� ����������� ������������ ������� ������, ��� �������� ������������� ����� �������� �����, ���� xxd �� ��������� ������ �� ������ ������������ �����.

"-l ����� " | " -len �����" ��������� ������ ����� ������ ��������� � ��������� < ����� > ���������� �������.

-p " | " -ps " | " -postscript " | " -plain ���������� ����������� ������ ������ ������������������ ����, ��������� ��� "�������" ����� ��� ����� "postscript".

-r " | " -revert �������� ����� �������� �� ���������������: ��������� ��������� �������������� ������������������ ������������� � �������� ��� (��� ��������� ��������� � �������� �������). ���� ����� ���������� �� � ����� ������������ ������, �� xxd ��������� ���������� ���� � ���������������� �����. ��� ������������� ���������� ������ -r -p ���������� ������ "��������" ������������������ ������������� ��� ������������� ���������� � ������� ����� � ������-���� ������������ ������� �������. ������� � ������� ����� ������ ����� ����������� � ����� ����� �������� ������.

-seek �������� ��� ������������� ����� ����� -r : ��������� ��������� < �������� > � �������� ��������, ������������ � �������� ������.

-s [\+][-]seek �������� ������ � ���������� ����������� (��� ��������������) < �������� > � ������ �� �������_�����. \+ ���������, ��� �������� �������� ������������� �� ��������� � ������� �������� ������� � ������ ������������ ����� (������������, ���� ������ ���������� �� �� ������ ������������ �����). - ���������, ��� ������ ���� ��������� ��������� ���������� �������� �� ����� ����� (����, ���� ���������� � \+ : ����� ������� ������� ����� � ������ ������������ �����). ���� ���� -s �� ������������, �� xxd �������� ������ �� ������� ������� � �����.

-u ���������� ����������������� ����� � ������� ��������. �� ��������� ������������ ����� � ������ �������� ��������.

-v " | " -version ���������� ���������� � ������ ���������.

��������� �����

xxd -r �������� ���������� ����������� ��� ������������� ���������� � ������� �����. ���� �������� ����� �� �������� �����, �� ������ ����� � ������ ������ ������ ������������������ ������������� ����� ���� ����������������, ��������� ������ ����� ���� ��������� ��� ������������ ���� � ������. � ���� ������� xxd ���������� lseek(2) ��� �������� � ��������� �������. ���� ����� �� �������� ����� ����������, �� ��������� ������ �������� �����, ������� ����������� �������� �������.

xxd -r ������� �� ������� ��������� �� �������. ����� ������������ �����.

��� �������������� ����������������� ������������� �������� ������ ��������� ��������, ��� xxd -r ���������� � ������ ����� ����� ������ ����� ��������� ������������ ���������� ������� ����������������� ������ (��. ���� -c). ��� ��������, ��� ���������, ��������� � ������� � ��������� ��������� ascii (��� ebcdic), ������ ������������. ��� �������� �������������� ������������������ ������������� � ����� postscript � ������� ������� xxd -r -p ���������� ������� �� �����������. � ���� ������ ������������ ��� �������, ������� ������ �� ���� ����������������� ����.

�������� �������� �� �������� ����� ���������

% xxd -i ����

% xxd -i \< ����

������� xxd -s \+seek ����� ���������� �� xxd -s seek, ��������� ��� ����, ����� "��������" ������ �� ����� �����, ������������ ����� lseek(2). ��� ������������� `+' ��������� ����� ����������, ���� ������� ������ ��������� � ������ ������������ �����, � ������� � ����� ������������ ����� �� ��������� � ������ ����� � ���� �������, ����� ��������� xxd �������� � ���������� � ������ �����. ������������� ������� ������� ��������� (��� �ݣ ������ ��������!) ��������...

������� ����� ������ ������������ �����; ����������, ��������� 'cat' ��� ��������� ������ �� ����� ������ ������������ �����:

% sh -c 'cat > plain_copy; xxd -s 0 > hex_copy' < file

����� ������������������ ������������� �� ������� � ����� 0x480 (= 1024+128). ������ `+' �������� "������������ ������� �������", ����� ������� `128' ����������� � ������� ���������, ��� ��������� ������ dd:

% sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet' < file

����� ������������������ ������������� �� ������� � ����� 0x100 (= 1024-768):

% sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +-768 > hex_snippet' < file

� �� �� �����, ������� ��������, ��� �������� �������� ����������� �������� �����, ��� ��� ������ `+' ������ �� ������������. ����� ������������ ��������� �� ������� xxd � ������� strace(1) ��� truss(1) � ��� �������, ����� ����������� ���� -s.

�������

������� �ӣ, ����� ������ �ң� ����� (0x30 ������) ����� file :

% xxd -s 0x30 file

������� ��� ������ (0x30 ������) �� ����� ����� file :

% xxd -s -0x30 file

������� 120 ������ � ���� ������������ ������������������ ������������� �� 20 ������� � ������:

% xxd -l 120 -ps -c 20 xxd.1

2e544820585844203120224d616e75616c207061

676520666f7220787864220a2e5c220a2e5c2220

32317374204d617920313939360a2e5c22204d61

6e207061676520617574686f723a0a2e5c222020

2020546f6e79204e7567656e74203c746f6e7940

7363746e7567656e2e7070702e67752e6564752e

������� ������ 120 ������ ���� �������� ����������� �� 12 ������� � ������:

% xxd -l 120 -c 12 xxd.1

0000000: 2e54 4820 5858 4420 3120 224d .TH XXD 1 "M

000000c: 616e 7561 6c20 7061 6765 2066 anual page f

0000018: 6f72 2078 7864 220a 2e5c 220a or xxd"..\\".

0000024: 2e5c 2220 3231 7374 204d 6179 .\\" 21st May

0000030: 2031 3939 360a 2e5c 2220 4d61 1996..\\" Ma

000003c: 6e20 7061 6765 2061 7574 686f n page autho

0000048: 723a 0a2e 5c22 2020 2020 546f r:..\\" To

0000054: 6e79 204e 7567 656e 7420 3c74 ny Nugent <t

0000060: 6f6e 7940 7363 746e 7567 656e ony@sctnugen

000006c: 2e70 7070 2e67 752e 6564 752e .ppp.gu.edu.

�������� ���� �� ����� xxd.1:

% xxd -s 0x28 -l 12 -c 12 xxd.1

0000028: 3231 7374 204d 6179 2031 3939 21st May 199

����������� �������_���� ��������_���� � ����������� 100 ������ �� ��������� 0x00 � ������ �����:

% xxd �������_���� | xxd -r -s 100 \> ��������_����

�������� ���� � ����� xxd.1:

% echo '0000029: 3574 68' | xxd -r - xxd.1

% xxd -s 0x28 -l 12 -c 12 xxd.1

0000028: 3235 7468 204d 6179 2031 3939 25th May 199

������� 65537-������� ����, ��� ����� �������� ����� �������� 0x00, ����� ���������� �����, ������� ������ ����� �������� 'A' (0x41):

% echo '010000: 41' | xxd -r \> file

������� ����������������� ������������� ����� ����� � �������������� ��������������� ��������:

% xxd -a -c 12 file

0000000: 0000 0000 0000 0000 0000 0000 ............

*

000fffc: 0000 0000 40 ....A

������� 1-������� ����, ���������� ������ 'A'. ����� ����� '-r -s' ����������� � ������� �����, ��������� � �����; ����� ������, �������������� ����� ������������:

% echo '010000: 41' | xxd -r -s -0x10000 \> file

xxd ����� ������������ � �������� ������� � ���������, �������� � vim(1), ����� ������� ����������������� ������������� ������� ����� ��������� `a' � `z':

:'a,'z!xxd

�� ������ ������������ xxd � �������� ������� � ���������, �������� � vim(1), ��� �������������� ������ �� ������������������ ������������� ����� ��������� `a' � `z':

:'a,'z!xxd -r

�� ������ ������������ xxd � �������� ������� � ���������, �������� � vim(1), ��� �������������� ������ �� ������������ ������ ������������������ �������������. ��������� ������ � ��������������� ������ � ��������

!!xxd -r

����� ��������� ������������ ������ �� ������ �����:

% xxd -c1 < /dev/term/b &

% stty < /dev/term/b -echo -opost -isig -icanon min 1

% echo -n foo > /dev/term/b

������������ ��������
��������� xxd ��������� ������ �� ���������� ����������:

0 ������ �� ����������.

-1 �������� �� �������������� (���������� xxd -r -i ���� ����������).

1 ������ ��� ������� ������ ��������� ������.

2 �������� �� ������� �����.

3 �������� � �������� �����.

4,5 ����������� ������� ������ �����������.

������ �����
uuencode(1), uudecode(1), patch(1)

��������������
���������� ���� ��������� ������������� ������������ ����� ţ ���������. ����������� ţ �� ���� ����� � ����. ��������� �����, ������������ ������, ����������� �����������.

������
��� �������� ����������� ������������� xxd ������ 1.7.
�����

(c) 1990-1997 ����� ������� (Juergen Weigert)

<jnweiger@informatik.uni-erlangen.de>

�� ������ �������� �������������� ��������� �� ������� �� ����.

���� ������������� ���� ��������� �������� ��� �����-�� �����, ���������� �� ����.

���� �� �������� ������, �� � ��� �� ���ޣ�.

������ ������� �������� ����������� ������� ���� ��������� (Tony Nugent)

<tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>

��������� ��������� ������� ������ ����������� (Bram Moolenaar). �������� ��������������� ������� ��������� (Juergen Weigert).