xref: /freebsd/usr.bin/hexdump/hexdump.1 (revision bdcbfde31e8e9b343f113a1956384bdf30d1ed62)
19b50d902SRodney W. Grimes.\" Copyright (c) 1989, 1990, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
69b50d902SRodney W. Grimes.\" are met:
79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
89b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
109b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
119b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
139b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
149b50d902SRodney W. Grimes.\"    without specific prior written permission.
159b50d902SRodney W. Grimes.\"
169b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
179b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
189b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
209b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
219b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
229b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
239b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
249b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
259b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
269b50d902SRodney W. Grimes.\" SUCH DAMAGE.
279b50d902SRodney W. Grimes.\"
28*ac2adfb8SFernando Apesteguía.Dd June 29, 2020
299b50d902SRodney W. Grimes.Dt HEXDUMP 1
309b50d902SRodney W. Grimes.Os
319b50d902SRodney W. Grimes.Sh NAME
3238d54d33SJoerg Wunsch.Nm hexdump , hd
33c6d6e772SAlexey Zelkin.Nd ASCII, decimal, hexadecimal, octal dump
349b50d902SRodney W. Grimes.Sh SYNOPSIS
358fe908efSRuslan Ermilov.Nm
36f84276e9SPoul-Henning Kamp.Op Fl bcCdovx
379b50d902SRodney W. Grimes.Op Fl e Ar format_string
389b50d902SRodney W. Grimes.Op Fl f Ar format_file
399b50d902SRodney W. Grimes.Op Fl n Ar length
409b50d902SRodney W. Grimes.Bk -words
41de9dd947SJohn-Mark Gurney.Op Fl s Ar offset
429b50d902SRodney W. Grimes.Ek
4347dec781SRuslan Ermilov.Ar
4438d54d33SJoerg Wunsch.Nm hd
4538d54d33SJoerg Wunsch.Op Fl bcdovx
4638d54d33SJoerg Wunsch.Op Fl e Ar format_string
4738d54d33SJoerg Wunsch.Op Fl f Ar format_file
4838d54d33SJoerg Wunsch.Op Fl n Ar length
4938d54d33SJoerg Wunsch.Bk -words
50de9dd947SJohn-Mark Gurney.Op Fl s Ar offset
5138d54d33SJoerg Wunsch.Ek
5247dec781SRuslan Ermilov.Ar
539b50d902SRodney W. Grimes.Sh DESCRIPTION
548fe908efSRuslan ErmilovThe
558fe908efSRuslan Ermilov.Nm
568fe908efSRuslan Ermilovutility is a filter which displays the specified files, or
579b50d902SRodney W. Grimesthe standard input, if no files are specified, in a user specified
589b50d902SRodney W. Grimesformat.
599b50d902SRodney W. Grimes.Pp
609b50d902SRodney W. GrimesThe options are as follows:
613898680cSPhilippe Charnier.Bl -tag -width indent
629b50d902SRodney W. Grimes.It Fl b
639b50d902SRodney W. Grimes.Em One-byte octal display .
649b50d902SRodney W. GrimesDisplay the input offset in hexadecimal, followed by sixteen
659b50d902SRodney W. Grimesspace-separated, three column, zero-filled, bytes of input data,
669b50d902SRodney W. Grimesin octal, per line.
679b50d902SRodney W. Grimes.It Fl c
689b50d902SRodney W. Grimes.Em One-byte character display .
699b50d902SRodney W. GrimesDisplay the input offset in hexadecimal, followed by sixteen
709b50d902SRodney W. Grimesspace-separated, three column, space-filled, characters of input
719b50d902SRodney W. Grimesdata per line.
72f84276e9SPoul-Henning Kamp.It Fl C
73f84276e9SPoul-Henning Kamp.Em Canonical hex+ASCII display .
74f84276e9SPoul-Henning KampDisplay the input offset in hexadecimal, followed by sixteen
75f84276e9SPoul-Henning Kampspace-separated, two column, hexadecimal bytes, followed by the
76f84276e9SPoul-Henning Kampsame sixteen bytes in %_p format enclosed in ``|'' characters.
7738d54d33SJoerg Wunsch.Pp
7838d54d33SJoerg WunschCalling the command
7938d54d33SJoerg Wunsch.Nm hd
8038d54d33SJoerg Wunschimplies this option.
819b50d902SRodney W. Grimes.It Fl d
829b50d902SRodney W. Grimes.Em Two-byte decimal display .
839b50d902SRodney W. GrimesDisplay the input offset in hexadecimal, followed by eight
849b50d902SRodney W. Grimesspace-separated, five column, zero-filled, two-byte units
859b50d902SRodney W. Grimesof input data, in unsigned decimal, per line.
869b50d902SRodney W. Grimes.It Fl e Ar format_string
879b50d902SRodney W. GrimesSpecify a format string to be used for displaying data.
889b50d902SRodney W. Grimes.It Fl f Ar format_file
899b50d902SRodney W. GrimesSpecify a file that contains one or more newline separated format strings.
909b50d902SRodney W. GrimesEmpty lines and lines whose first non-blank character is a hash mark
919b50d902SRodney W. Grimes.Pf ( Cm \&# )
929b50d902SRodney W. Grimesare ignored.
939b50d902SRodney W. Grimes.It Fl n Ar length
949b50d902SRodney W. GrimesInterpret only
959b50d902SRodney W. Grimes.Ar length
969b50d902SRodney W. Grimesbytes of input.
979b50d902SRodney W. Grimes.It Fl o
989b50d902SRodney W. Grimes.Em Two-byte octal display .
999b50d902SRodney W. GrimesDisplay the input offset in hexadecimal, followed by eight
1009b50d902SRodney W. Grimesspace-separated, six column, zero-filled, two byte quantities of
1019b50d902SRodney W. Grimesinput data, in octal, per line.
1029b50d902SRodney W. Grimes.It Fl s Ar offset
1039b50d902SRodney W. GrimesSkip
1049b50d902SRodney W. Grimes.Ar offset
1059b50d902SRodney W. Grimesbytes from the beginning of the input.
1069b50d902SRodney W. GrimesBy default,
1079b50d902SRodney W. Grimes.Ar offset
1089b50d902SRodney W. Grimesis interpreted as a decimal number.
1099b50d902SRodney W. GrimesWith a leading
1109b50d902SRodney W. Grimes.Cm 0x
1119b50d902SRodney W. Grimesor
1129b50d902SRodney W. Grimes.Cm 0X ,
1139b50d902SRodney W. Grimes.Ar offset
1149b50d902SRodney W. Grimesis interpreted as a hexadecimal number,
1159b50d902SRodney W. Grimesotherwise, with a leading
1169b50d902SRodney W. Grimes.Cm 0 ,
1179b50d902SRodney W. Grimes.Ar offset
1189b50d902SRodney W. Grimesis interpreted as an octal number.
1199b50d902SRodney W. GrimesAppending the character
1209b50d902SRodney W. Grimes.Cm b ,
1219b50d902SRodney W. Grimes.Cm k ,
1229b50d902SRodney W. Grimesor
1239b50d902SRodney W. Grimes.Cm m
1249b50d902SRodney W. Grimesto
1259b50d902SRodney W. Grimes.Ar offset
1269b50d902SRodney W. Grimescauses it to be interpreted as a multiple of
1279b50d902SRodney W. Grimes.Li 512 ,
1289b50d902SRodney W. Grimes.Li 1024 ,
1299b50d902SRodney W. Grimesor
1309b50d902SRodney W. Grimes.Li 1048576 ,
1319b50d902SRodney W. Grimesrespectively.
1329b50d902SRodney W. Grimes.It Fl v
1333898680cSPhilippe CharnierCause
1348fe908efSRuslan Ermilov.Nm
1358fe908efSRuslan Ermilovto display all input data.
1369b50d902SRodney W. GrimesWithout the
1379b50d902SRodney W. Grimes.Fl v
1389b50d902SRodney W. Grimesoption, any number of groups of output lines, which would be
1399b50d902SRodney W. Grimesidentical to the immediately preceding group of output lines (except
1409b50d902SRodney W. Grimesfor the input offsets), are replaced with a line comprised of a
1419b50d902SRodney W. Grimessingle asterisk.
1429b50d902SRodney W. Grimes.It Fl x
1439b50d902SRodney W. Grimes.Em Two-byte hexadecimal display .
1449b50d902SRodney W. GrimesDisplay the input offset in hexadecimal, followed by eight, space
1459b50d902SRodney W. Grimesseparated, four column, zero-filled, two-byte quantities of input
1469b50d902SRodney W. Grimesdata, in hexadecimal, per line.
1479b50d902SRodney W. Grimes.El
1489b50d902SRodney W. Grimes.Pp
1499b50d902SRodney W. GrimesFor each input file,
1508fe908efSRuslan Ermilov.Nm
1519b50d902SRodney W. Grimessequentially copies the input to standard output, transforming the
1529b50d902SRodney W. Grimesdata according to the format strings specified by the
1539b50d902SRodney W. Grimes.Fl e
1549b50d902SRodney W. Grimesand
1559b50d902SRodney W. Grimes.Fl f
1569b50d902SRodney W. Grimesoptions, in the order that they were specified.
1579b50d902SRodney W. Grimes.Ss Formats
1589b50d902SRodney W. GrimesA format string contains any number of format units, separated by
1599b50d902SRodney W. Grimeswhitespace.
1609b50d902SRodney W. GrimesA format unit contains up to three items: an iteration count, a byte
1619b50d902SRodney W. Grimescount, and a format.
1629b50d902SRodney W. Grimes.Pp
1639b50d902SRodney W. GrimesThe iteration count is an optional positive integer, which defaults to
1649b50d902SRodney W. Grimesone.
1659b50d902SRodney W. GrimesEach format is applied iteration count times.
1669b50d902SRodney W. Grimes.Pp
1679b50d902SRodney W. GrimesThe byte count is an optional positive integer.
1689b50d902SRodney W. GrimesIf specified it defines the number of bytes to be interpreted by
1699b50d902SRodney W. Grimeseach iteration of the format.
1709b50d902SRodney W. Grimes.Pp
1719b50d902SRodney W. GrimesIf an iteration count and/or a byte count is specified, a single slash
1729b50d902SRodney W. Grimesmust be placed after the iteration count and/or before the byte count
1739b50d902SRodney W. Grimesto disambiguate them.
1749b50d902SRodney W. GrimesAny whitespace before or after the slash is ignored.
1759b50d902SRodney W. Grimes.Pp
1769b50d902SRodney W. GrimesThe format is required and must be surrounded by double quote
1779b50d902SRodney W. Grimes(" ") marks.
1789b50d902SRodney W. GrimesIt is interpreted as a fprintf-style format string (see
1799b50d902SRodney W. Grimes.Xr fprintf 3 ) ,
1809b50d902SRodney W. Grimeswith the
1819b50d902SRodney W. Grimesfollowing exceptions:
1829b50d902SRodney W. Grimes.Bl -bullet -offset indent
1839b50d902SRodney W. Grimes.It
1849b50d902SRodney W. GrimesAn asterisk (*) may not be used as a field width or precision.
1859b50d902SRodney W. Grimes.It
1869b50d902SRodney W. GrimesA byte count or field precision
1879b50d902SRodney W. Grimes.Em is
1889b50d902SRodney W. Grimesrequired for each ``s'' conversion
1899b50d902SRodney W. Grimescharacter (unlike the
1909b50d902SRodney W. Grimes.Xr fprintf 3
1919b50d902SRodney W. Grimesdefault which prints the entire string if the precision is unspecified).
1929b50d902SRodney W. Grimes.It
1939b50d902SRodney W. GrimesThe conversion characters ``h'', ``l'', ``n'', ``p'' and ``q'' are
1949b50d902SRodney W. Grimesnot supported.
1959b50d902SRodney W. Grimes.It
1969b50d902SRodney W. GrimesThe single character escape sequences
1979b50d902SRodney W. Grimesdescribed in the C standard are supported:
1989b50d902SRodney W. Grimes.Bd -ragged -offset indent -compact
1999b50d902SRodney W. Grimes.Bl -column <alert_character>
200c2965cd1SJoel Dahl.It "NUL	\e0"
201c2965cd1SJoel Dahl.It "<alert character>	\ea"
202c2965cd1SJoel Dahl.It "<backspace>	\eb"
203c2965cd1SJoel Dahl.It "<form-feed>	\ef"
204c2965cd1SJoel Dahl.It "<newline>	\en"
205c2965cd1SJoel Dahl.It "<carriage return>	\er"
206c2965cd1SJoel Dahl.It "<tab>	\et"
207c2965cd1SJoel Dahl.It "<vertical tab>	\ev"
2089b50d902SRodney W. Grimes.El
2099b50d902SRodney W. Grimes.Ed
2109b50d902SRodney W. Grimes.El
2119b50d902SRodney W. Grimes.Pp
2123898680cSPhilippe CharnierThe
2133898680cSPhilippe Charnier.Nm
2143898680cSPhilippe Charnierutility also supports the following additional conversion strings:
2159b50d902SRodney W. Grimes.Bl -tag -width Fl
2169b50d902SRodney W. Grimes.It Cm \&_a Ns Op Cm dox
2179b50d902SRodney W. GrimesDisplay the input offset, cumulative across input files, of the
2189b50d902SRodney W. Grimesnext byte to be displayed.
2199b50d902SRodney W. GrimesThe appended characters
2209b50d902SRodney W. Grimes.Cm d ,
2219b50d902SRodney W. Grimes.Cm o ,
2229b50d902SRodney W. Grimesand
2239b50d902SRodney W. Grimes.Cm x
2249b50d902SRodney W. Grimesspecify the display base
2259b50d902SRodney W. Grimesas decimal, octal or hexadecimal respectively.
2269b50d902SRodney W. Grimes.It Cm \&_A Ns Op Cm dox
2279b50d902SRodney W. GrimesIdentical to the
2289b50d902SRodney W. Grimes.Cm \&_a
2299b50d902SRodney W. Grimesconversion string except that it is only performed
2309b50d902SRodney W. Grimesonce, when all of the input data has been processed.
2319b50d902SRodney W. Grimes.It Cm \&_c
2329b50d902SRodney W. GrimesOutput characters in the default character set.
2339b50d902SRodney W. GrimesNonprinting characters are displayed in three character, zero-padded
2349b50d902SRodney W. Grimesoctal, except for those representable by standard escape notation
2359b50d902SRodney W. Grimes(see above),
2369b50d902SRodney W. Grimeswhich are displayed as two character strings.
2379b50d902SRodney W. Grimes.It Cm _p
2389b50d902SRodney W. GrimesOutput characters in the default character set.
2399b50d902SRodney W. GrimesNonprinting characters are displayed as a single
2409b50d902SRodney W. Grimes.Dq Cm \&. .
2419b50d902SRodney W. Grimes.It Cm _u
242*ac2adfb8SFernando ApesteguíaOutput US ASCII
2433898680cSPhilippe Charniercharacters, with the exception that control characters are
2449b50d902SRodney W. Grimesdisplayed using the following, lower-case, names.
2459b50d902SRodney W. GrimesCharacters greater than 0xff, hexadecimal, are displayed as hexadecimal
2469b50d902SRodney W. Grimesstrings.
247748611c9SJoel Dahl.Bl -column 000_nu 001_so 002_st 003_et 004_eo
248748611c9SJoel Dahl.It "000 NUL" Ta "001 SOH" Ta "002 STX" Ta "003 ETX" Ta "004 EOT" Ta "005 ENQ"
249748611c9SJoel Dahl.It "006 ACK" Ta "007 BEL" Ta "008 BS" Ta "009 HT" Ta "00A LF" Ta "00B VT"
250748611c9SJoel Dahl.It "00C FF" Ta "00D CR" Ta "00E\ SO" Ta "00F SI" Ta "010 DLE" Ta "011 DC1"
251748611c9SJoel Dahl.It "012 DC2" Ta "013 DC3" Ta "014 DC4" Ta "015\ NAK" Ta "016 SYN" Ta "017 ETB"
252748611c9SJoel Dahl.It "018 CAN" Ta "019 EM" Ta "01A SUB" Ta "01B ESC" Ta "01C FS" Ta "01D GS"
253748611c9SJoel Dahl.It "01E RS" Ta "01F US" Ta "07F DEL" Ta \& Ta \& Ta \&
2549b50d902SRodney W. Grimes.El
2559b50d902SRodney W. Grimes.El
2569b50d902SRodney W. Grimes.Pp
2579b50d902SRodney W. GrimesThe default and supported byte counts for the conversion characters
2589b50d902SRodney W. Grimesare as follows:
2599b50d902SRodney W. Grimes.Bl -tag -width  "Xc,_Xc,_Xc,_Xc,_Xc,_Xc" -offset indent
2609b50d902SRodney W. Grimes.It Li \&%_c , \&%_p , \&%_u , \&%c
2619b50d902SRodney W. GrimesOne byte counts only.
2629b50d902SRodney W. Grimes.It Xo
2639b50d902SRodney W. Grimes.Li \&%d , \&%i , \&%o ,
2649b50d902SRodney W. Grimes.Li \&%u , \&%X , \&%x
2659b50d902SRodney W. Grimes.Xc
2669b50d902SRodney W. GrimesFour byte default, one, two and four byte counts supported.
2679b50d902SRodney W. Grimes.It Xo
2689b50d902SRodney W. Grimes.Li \&%E , \&%e , \&%f ,
2699b50d902SRodney W. Grimes.Li \&%G , \&%g
2709b50d902SRodney W. Grimes.Xc
27182866376STim J. RobbinsEight byte default, four and twelve byte counts supported.
2729b50d902SRodney W. Grimes.El
2739b50d902SRodney W. Grimes.Pp
2749b50d902SRodney W. GrimesThe amount of data interpreted by each format string is the sum of the
2759b50d902SRodney W. Grimesdata required by each format unit, which is the iteration count times the
2769b50d902SRodney W. Grimesbyte count, or the iteration count times the number of bytes required by
2779b50d902SRodney W. Grimesthe format if the byte count is not specified.
2789b50d902SRodney W. Grimes.Pp
2799b50d902SRodney W. GrimesThe input is manipulated in ``blocks'', where a block is defined as the
2809b50d902SRodney W. Grimeslargest amount of data specified by any format string.
2819b50d902SRodney W. GrimesFormat strings interpreting less than an input block's worth of data,
2829b50d902SRodney W. Grimeswhose last format unit both interprets some number of bytes and does
2839b50d902SRodney W. Grimesnot have a specified iteration count, have the iteration count
2849b50d902SRodney W. Grimesincremented until the entire input block has been processed or there
2859b50d902SRodney W. Grimesis not enough data remaining in the block to satisfy the format string.
2869b50d902SRodney W. Grimes.Pp
2878fe908efSRuslan ErmilovIf, either as a result of user specification or
2888fe908efSRuslan Ermilov.Nm
2898fe908efSRuslan Ermilovmodifying
2909b50d902SRodney W. Grimesthe iteration count as described above, an iteration count is
2919b50d902SRodney W. Grimesgreater than one, no trailing whitespace characters are output
2929b50d902SRodney W. Grimesduring the last iteration.
2939b50d902SRodney W. Grimes.Pp
2949b50d902SRodney W. GrimesIt is an error to specify a byte count as well as multiple conversion
2959b50d902SRodney W. Grimescharacters or strings unless all but one of the conversion characters
2969b50d902SRodney W. Grimesor strings is
2979b50d902SRodney W. Grimes.Cm \&_a
2989b50d902SRodney W. Grimesor
2999b50d902SRodney W. Grimes.Cm \&_A .
3009b50d902SRodney W. Grimes.Pp
3019b50d902SRodney W. GrimesIf, as a result of the specification of the
3029b50d902SRodney W. Grimes.Fl n
3039b50d902SRodney W. Grimesoption or end-of-file being reached, input data only partially
3049b50d902SRodney W. Grimessatisfies a format string, the input block is zero-padded sufficiently
3056a3e8b0aSRuslan Ermilovto display all available data (i.e., any format units overlapping the
3069b50d902SRodney W. Grimesend of data will display some number of the zero bytes).
3079b50d902SRodney W. Grimes.Pp
3089b50d902SRodney W. GrimesFurther output by such format strings is replaced by an equivalent
3099b50d902SRodney W. Grimesnumber of spaces.
3109b50d902SRodney W. GrimesAn equivalent number of spaces is defined as the number of spaces
3119b50d902SRodney W. Grimesoutput by an
3129b50d902SRodney W. Grimes.Cm s
3139b50d902SRodney W. Grimesconversion character with the same field width
3149b50d902SRodney W. Grimesand precision as the original conversion character or conversion
3159b50d902SRodney W. Grimesstring but with any
3169b50d902SRodney W. Grimes.Dq Li \&+ ,
3179b50d902SRodney W. Grimes.Dq \&\ \& ,
3189b50d902SRodney W. Grimes.Dq Li \&#
3199b50d902SRodney W. Grimesconversion flag characters
3209b50d902SRodney W. Grimesremoved, and referencing a NULL string.
3219b50d902SRodney W. Grimes.Pp
3229b50d902SRodney W. GrimesIf no format strings are specified, the default display is equivalent
3239b50d902SRodney W. Grimesto specifying the
3249b50d902SRodney W. Grimes.Fl x
3259b50d902SRodney W. Grimesoption.
326a866e170SRuslan Ermilov.Sh EXIT STATUS
3276658f7a1SRuslan Ermilov.Ex -std hexdump hd
3289b50d902SRodney W. Grimes.Sh EXAMPLES
329*ac2adfb8SFernando ApesteguíaDump input in canonical (hex+ASCII) form:
330*ac2adfb8SFernando Apesteguía.Bd -literal -offset indent
331*ac2adfb8SFernando Apesteguía$ echo "FreeBSD: The power to serve" | hexdump -C
332*ac2adfb8SFernando Apesteguía00000000  46 72 65 65 42 53 44 3a  20 54 68 65 20 70 6f 77  |FreeBSD: The pow|
333*ac2adfb8SFernando Apesteguía00000010  65 72 20 74 6f 20 73 65  72 76 65 0a              |er to serve.|
334*ac2adfb8SFernando Apesteguía0000001c
335*ac2adfb8SFernando Apesteguía.Ed
336*ac2adfb8SFernando Apesteguía.Pp
337*ac2adfb8SFernando ApesteguíaSame as above but skipping the first 4 bytes of stdin and interpreting only 3
338*ac2adfb8SFernando Apesteguíabytes of input:
339*ac2adfb8SFernando Apesteguía.Bd -literal -offset indent
340*ac2adfb8SFernando Apesteguía$ echo "FreeBSD: The power to serve" | hexdump -C -s 4 -n 3
341*ac2adfb8SFernando Apesteguía00000004  42 53 44                                          |BSD|
342*ac2adfb8SFernando Apesteguía00000007
343*ac2adfb8SFernando Apesteguía.Ed
344*ac2adfb8SFernando Apesteguía.Pp
345*ac2adfb8SFernando ApesteguíaAssuming a format file named
346*ac2adfb8SFernando Apesteguía.Pa format.txt
347*ac2adfb8SFernando Apesteguíawith the following contents that specify a perusal format:
3489b50d902SRodney W. Grimes.Bd -literal -offset indent
3499b50d902SRodney W. Grimes"%06.6_ao "  12/1 "%3_u "
3509b50d902SRodney W. Grimes"\et\et" "%_p "
3519b50d902SRodney W. Grimes"\en"
3529b50d902SRodney W. Grimes.Ed
3539b50d902SRodney W. Grimes.Pp
354*ac2adfb8SFernando ApesteguíaDump input in canonical form using the format in
355*ac2adfb8SFernando Apesteguía.Pa format.txt :
356*ac2adfb8SFernando Apesteguía.Bd -literal -offset indent
357*ac2adfb8SFernando Apesteguía$ echo "FreeBSD" | hexdump -f format.txt -C
358*ac2adfb8SFernando Apesteguía000000   F   r   e   e   B   S   D  lf                          F r e e B S D .
359*ac2adfb8SFernando Apesteguía00000000  46 72 65 65 42 53 44 0a                           |FreeBSD.|
360*ac2adfb8SFernando Apesteguía00000008
361*ac2adfb8SFernando Apesteguía.Ed
362*ac2adfb8SFernando Apesteguía.Pp
363*ac2adfb8SFernando ApesteguíaAssuming a format file named
364*ac2adfb8SFernando Apesteguía.Pa format.txt
365*ac2adfb8SFernando Apesteguíawith the following contents that simulate the
366*ac2adfb8SFernando Apesteguía.Fl x
367*ac2adfb8SFernando Apesteguíaoption:
3689b50d902SRodney W. Grimes.Bd -literal -offset indent
3699b50d902SRodney W. Grimes"%07.7_Ax\en"
3709b50d902SRodney W. Grimes"%07.7_ax  " 8/2 "%04x " "\en"
3719b50d902SRodney W. Grimes.Ed
372*ac2adfb8SFernando Apesteguía.Pp
373*ac2adfb8SFernando ApesteguíaDump input in canonical form using the format in
374*ac2adfb8SFernando Apesteguía.Pa format.txt :
375*ac2adfb8SFernando Apesteguía.Bd -literal -offset indent
376*ac2adfb8SFernando Apesteguía$ echo "FreeBSD: The power to serve" | hexdump -f format.txt -C
377*ac2adfb8SFernando Apesteguía0000000  7246 6565 5342 3a44 5420 6568 7020 776f
378*ac2adfb8SFernando Apesteguía00000000  46 72 65 65 42 53 44 3a  20 54 68 65 20 70 6f 77  |FreeBSD: The pow|
379*ac2adfb8SFernando Apesteguía0000010  7265 7420 206f 6573 7672 0a65
380*ac2adfb8SFernando Apesteguía00000010  65 72 20 74 6f 20 73 65  72 76 65 0a              |er to serve.|
381*ac2adfb8SFernando Apesteguía0000001c
382*ac2adfb8SFernando Apesteguía.Ed
3839b50d902SRodney W. Grimes.Sh SEE ALSO
384ee38feb2STim J. Robbins.Xr od 1
385