Mercurial > vim
comparison runtime/doc/xxd.1 @ 216:da182deebec7
updated for version 7.0061
author | vimboss |
---|---|
date | Fri, 18 Mar 2005 20:25:31 +0000 |
parents | 125e80798a85 |
children | 9f345c48220b |
comparison
equal
deleted
inserted
replaced
215:a4029d1d83df | 216:da182deebec7 |
---|---|
19 .SH DESCRIPTION | 19 .SH DESCRIPTION |
20 .I xxd | 20 .I xxd |
21 creates a hex dump of a given file or standard input. | 21 creates a hex dump of a given file or standard input. |
22 It can also convert a hex dump back to its original binary form. | 22 It can also convert a hex dump back to its original binary form. |
23 Like | 23 Like |
24 .BR uuencode(1) | 24 .BR uuencode (1) |
25 and | 25 and |
26 .BR uudecode(1) | 26 .BR uudecode (1) |
27 it allows the transmission of binary data in a `mail-safe' ASCII representation, | 27 it allows the transmission of binary data in a `mail-safe' ASCII representation, |
28 but has the advantage of decoding to standard output. | 28 but has the advantage of decoding to standard output. |
29 Moreover, it can be used to perform binary file patching. | 29 Moreover, it can be used to perform binary file patching. |
30 .SH OPTIONS | 30 .SH OPTIONS |
31 If no | 31 If no |
112 particular column layout. Additional Whitespace and line-breaks are allowed | 112 particular column layout. Additional Whitespace and line-breaks are allowed |
113 anywhere. | 113 anywhere. |
114 .TP | 114 .TP |
115 .I \-seek offset | 115 .I \-seek offset |
116 When used after | 116 When used after |
117 .I \-r | 117 .IR \-r : |
118 : revert with | 118 revert with |
119 .RI < offset > | 119 .RI < offset > |
120 added to file positions found in hexdump. | 120 added to file positions found in hexdump. |
121 .TP | 121 .TP |
122 .I \-s [\+][\-]seek | 122 .I \-s [+][\-]seek |
123 start at | 123 start at |
124 .RI < seek > | 124 .RI < seek > |
125 bytes abs. (or rel.) infile offset. | 125 bytes abs. (or rel.) infile offset. |
126 \fI\+ \fRindicates that the seek is relative to the current stdin file position | 126 \fI+ fRindicates that the seek is relative to the current stdin file position |
127 (meaningless when not reading from stdin). \fI\- \fRindicates that the seek | 127 (meaningless when not reading from stdin). \fI\- \fRindicates that the seek |
128 should be that many characters from the end of the input (or if combined with | 128 should be that many characters from the end of the input (or if combined with |
129 \fI \+ \fR: before the current stdin file position). | 129 \fI+\fR: before the current stdin file position). |
130 Without \-s option, xxd starts at the current file position. | 130 Without \-s option, xxd starts at the current file position. |
131 .TP | 131 .TP |
132 .I \-u | 132 .I \-u |
133 use upper case hex letters. Default is lower case. | 133 use upper case hex letters. Default is lower case. |
134 .TP | 134 .TP |
157 .br | 157 .br |
158 \fI% xxd \-i file\fR | 158 \fI% xxd \-i file\fR |
159 .br | 159 .br |
160 and | 160 and |
161 .br | 161 .br |
162 \fI% xxd \-i \< file\fR | 162 \fI% xxd \-i < file\fR |
163 .PP | 163 .PP |
164 .I xxd \-s \+seek | 164 .I xxd \-s \+seek |
165 may be different from | 165 may be different from |
166 .I xxd \-s seek | 166 .IR "xxd \-s seek" , |
167 , as lseek(2) is used to "rewind" input. A '+' | 167 as lseek(2) is used to "rewind" input. A '+' |
168 makes a difference if the input source is stdin, and if stdin's file position | 168 makes a difference if the input source is stdin, and if stdin's file position |
169 is not at the start of the file by the time xxd is started and given its input. | 169 is not at the start of the file by the time xxd is started and given its input. |
170 The following examples may help to clarify (or further confuse!)... | 170 The following examples may help to clarify (or further confuse!)... |
171 .PP | 171 .PP |
172 Rewind stdin before reading; needed because the `cat' has already read to the | 172 Rewind stdin before reading; needed because the `cat' has already read to the |
178 The `+' sign means "relative to the current position", thus the `128' adds to | 178 The `+' sign means "relative to the current position", thus the `128' adds to |
179 the 1k where dd left off. | 179 the 1k where dd left off. |
180 .br | 180 .br |
181 \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file | 181 \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file |
182 .PP | 182 .PP |
183 Hexdump from file position 0x100 ( = 1024-768) on. | 183 Hexdump from file position 0x100 ( = 1024\-768) on. |
184 .br | 184 .br |
185 \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file | 185 \fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file |
186 .PP | 186 .PP |
187 However, this is a rare situation and the use of `+' is rarely needed. | 187 However, this is a rare situation and the use of `+' is rarely needed. |
188 The author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever \-s is used. | 188 The author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever \-s is used. |