@@ -30,7 +30,7 @@ OPTIONS
3030 notation. Thus -c8, -c 8, -c 010 and -cols 8 are all equivalent.
3131
3232 -a | -autoskip
33- toggle autoskip: A single '*' replaces nul-lines. Default off.
33+ Toggle autoskip: A single '*' replaces nul-lines. Default off.
3434
3535 -b | -bits
3636 Switch to bits (binary digits) dump, rather than hexdump. This
@@ -41,9 +41,13 @@ OPTIONS
4141 mode.
4242
4343 -c cols | -cols cols
44- format <cols> octets per line. Default 16 (-i: 12, -ps: 30, -b:
44+ Format <cols> octets per line. Default 16 (-i: 12, -ps: 30, -b:
4545 6). Max 256.
4646
47+ -C | -capitalize
48+ Capitalize variable names in C include file style, when using
49+ -i.
50+
4751 -E | -EBCDIC
4852 Change the character encoding in the righthand column from ASCII
4953 to EBCDIC. This does not change the hexadecimal representation.
@@ -52,105 +56,105 @@ OPTIONS
5256 -e Switch to little-endian hexdump. This option treats byte groups
5357 as words in little-endian byte order. The default grouping of 4
5458 bytes may be changed using -g. This option only applies to hex‐
55- dump, leaving the ASCII (or EBCDIC) representation unchanged.
59+ dump, leaving the ASCII (or EBCDIC) representation unchanged.
5660 The command line switches -r, -p, -i do not work with this mode.
5761
5862 -g bytes | -groupsize bytes
59- separate the output of every <bytes> bytes (two hex characters
63+ Separate the output of every <bytes> bytes (two hex characters
6064 or eight bit-digits each) by a whitespace. Specify -g 0 to sup‐
6165 press grouping. <Bytes> defaults to 2 in normal mode, 4 in lit‐
62- tle-endian mode and 1 in bits mode. Grouping does not apply to
66+ tle-endian mode and 1 in bits mode. Grouping does not apply to
6367 postscript or include style.
6468
6569 -h | -help
66- print a summary of available commands and exit. No hex dumping
70+ Print a summary of available commands and exit. No hex dumping
6771 is performed.
6872
6973 -i | -include
70- output in C include file style. A complete static array defini‐
71- tion is written (named after the input file), unless xxd reads
74+ Output in C include file style. A complete static array defini‐
75+ tion is written (named after the input file), unless xxd reads
7276 from stdin.
7377
7478 -l len | -len len
75- stop after writing <len> octets.
79+ Stop after writing <len> octets.
7680
7781 -o offset
78- add <offset> to the displayed file position.
82+ Add <offset> to the displayed file position.
7983
8084 -p | -ps | -postscript | -plain
81- output in postscript continuous hexdump style. Also known as
85+ Output in postscript continuous hexdump style. Also known as
8286 plain hexdump style.
8387
8488 -r | -revert
85- reverse operation: convert (or patch) hexdump into binary. If
86- not writing to stdout, xxd writes into its output file without
89+ Reverse operation: convert (or patch) hexdump into binary. If
90+ not writing to stdout, xxd writes into its output file without
8791 truncating it. Use the combination -r -p to read plain hexadeci‐
8892 mal dumps without line number information and without a particu‐
89- lar column layout. Additional Whitespace and line-breaks are
93+ lar column layout. Additional Whitespace and line-breaks are
9094 allowed anywhere.
9195
9296 -seek offset
9397 When used after -r: revert with <offset> added to file positions
9498 found in hexdump.
9599
96100 -s [+][-]seek
97- start at <seek> bytes abs. (or rel.) infile offset. + indicates
98- that the seek is relative to the current stdin file position
101+ Start at <seek> bytes abs. (or rel.) infile offset. + indicates
102+ that the seek is relative to the current stdin file position
99103 (meaningless when not reading from stdin). - indicates that the
100- seek should be that many characters from the end of the input
104+ seek should be that many characters from the end of the input
101105 (or if combined with +: before the current stdin file position).
102106 Without -s option, xxd starts at the current file position.
103107
104- -u use upper case hex letters. Default is lower case.
108+ -u Use upper case hex letters. Default is lower case.
105109
106110 -v | -version
107- show version string.
111+ Show version string.
108112
109113CAVEATS
110114 xxd -r has some builtin magic while evaluating line number information.
111- If the output file is seekable, then the linenumbers at the start of
112- each hexdump line may be out of order, lines may be missing, or over‐
113- lapping. In these cases xxd will lseek(2) to the next position. If the
114- output file is not seekable, only gaps are allowed, which will be
115+ If the output file is seekable, then the linenumbers at the start of
116+ each hexdump line may be out of order, lines may be missing, or over‐
117+ lapping. In these cases xxd will lseek(2) to the next position. If the
118+ output file is not seekable, only gaps are allowed, which will be
115119 filled by null-bytes.
116120
117121 xxd -r never generates parse errors. Garbage is silently skipped.
118122
119- When editing hexdumps, please note that xxd -r skips everything on the
123+ When editing hexdumps, please note that xxd -r skips everything on the
120124 input line after reading enough columns of hexadecimal data (see option
121- -c). This also means, that changes to the printable ascii (or ebcdic)
122- columns are always ignored. Reverting a plain (or postscript) style
123- hexdump with xxd -r -p does not depend on the correct number of col‐
124- umns. Here anything that looks like a pair of hex-digits is inter‐
125+ -c). This also means, that changes to the printable ascii (or ebcdic)
126+ columns are always ignored. Reverting a plain (or postscript) style
127+ hexdump with xxd -r -p does not depend on the correct number of col‐
128+ umns. Here anything that looks like a pair of hex-digits is inter‐
125129 preted.
126130
127131 Note the difference between
128132 % xxd -i file
129133 and
130134 % xxd -i < file
131135
132- xxd -s +seek may be different from xxd -s seek, as lseek(2) is used to
136+ xxd -s +seek may be different from xxd -s seek, as lseek(2) is used to
133137 "rewind" input. A '+' makes a difference if the input source is stdin,
134- and if stdin's file position is not at the start of the file by the
135- time xxd is started and given its input. The following examples may
138+ and if stdin's file position is not at the start of the file by the
139+ time xxd is started and given its input. The following examples may
136140 help to clarify (or further confuse!)...
137141
138- Rewind stdin before reading; needed because the `cat' has already read
142+ Rewind stdin before reading; needed because the `cat' has already read
139143 to the end of stdin.
140144 % sh -c "cat > plain_copy; xxd -s 0 > hex_copy" < file
141145
142- Hexdump from file position 0x480 (=1024+128) onwards. The `+' sign
146+ Hexdump from file position 0x480 (=1024+128) onwards. The `+' sign
143147 means "relative to the current position", thus the `128' adds to the 1k
144148 where dd left off.
145- % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet"
149+ % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet"
146150 < file
147151
148152 Hexdump from file position 0x100 ( = 1024-768) on.
149153 % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +-768 > hex_snippet"
150154 < file
151155
152- However, this is a rare situation and the use of `+' is rarely needed.
153- The author prefers to monitor the effect of xxd with strace(1) or
156+ However, this is a rare situation and the use of `+' is rarely needed.
157+ The author prefers to monitor the effect of xxd with strace(1) or
154158 truss(1), whenever -s is used.
155159
156160EXAMPLES
@@ -194,7 +198,7 @@ EXAMPLES
194198 % xxd -s 0x36 -l 13 -c 13 xxd.1
195199 0000036: 3235 7468 204d 6179 2031 3939 36 25th May 1996
196200
197- Create a 65537 byte file with all bytes 0x00, except for the last one
201+ Create a 65537 byte file with all bytes 0x00, except for the last one
198202 which is 'A' (hex 0x41).
199203 % echo "010000: 41" | xxd -r > file
200204
@@ -204,7 +208,7 @@ EXAMPLES
204208 *
205209 000fffc: 0000 0000 40 ....A
206210
207- Create a 1 byte file containing a single 'A' character. The number
211+ Create a 1 byte file containing a single 'A' character. The number
208212 after '-r -s' adds to the linenumbers found in the file; in effect, the
209213 leading bytes are suppressed.
210214 % echo "010000: 41" | xxd -r -s -0x10000 > file
@@ -245,7 +249,7 @@ SEE ALSO
245249 uuencode(1), uudecode(1), patch(1)
246250
247251WARNINGS
248- The tools weirdness matches its creators brain. Use entirely at your
252+ The tools weirdness matches its creators brain. Use entirely at your
249253 own risk. Copy files. Trace it. Become a wizard.
250254
251255VERSION
0 commit comments