(Video materials in preparation)
xdump : Displays a hexadecimal dump of a file
Usage : xdump [-vlcn] [<n>...] <file>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 1
The xdump command displays a hexadecimal dump of the specified file.
If <file> is omitted or specified as "-" then the command reads from
standard input.
By default, 16 characters per line are displayed.
$ cat data
12345678901234567890
$ xdump data
31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36
37 38 39 30 0A
You can specify any number of characters per line to dump. In this
example, we dump 10 characters per line.
This makes it easy to read when viewing a fixed-width file.
$ xdump 10 data
31 32 33 34 35 36 37 38 39 30
31 32 33 34 35 36 37 38 39 30
0A
Dump 5 characters, then 3 characters, then 4 characters.
Makes it easy to dump each field separately for fixed-width files.
$ xdump 5 3 4 data
31 32 33 34 35
36 37 38
39 30 31 32
33 34 35 36 37
38 39 30
0A
The -v option causes the ASCII equivalent to be displayed on the
right-hand side.
Multi-byte characters cannot be displayed. Non-printable characters
are displayed as ".".
$ xdump -v 10 data
31 32 33 34 35 36 37 38 39 30 : 1234567890
31 32 33 34 35 36 37 38 39 30 : 1234567890
0A : .
The -l option displays line numbers on each line.
This is convenient when displaying fixed-width data.
$ xdump -l 10 data
00000001 : 31 32 33 34 35 36 37 38 39 30
00000002 : 31 32 33 34 35 36 37 38 39 30
00000003 : 0A
The -l option displays line numbers.
If you also specify multiple settings for characters per line,
field numbers are appended to the line numbers as follows:
$ xdump -l 5 3 4 data
00000001-00001 : 31 32 33 34 35
00000001-00002 : 36 37 38
00000001-00003 : 39 30 31 32
00000002-00001 : 33 34 35 36 37
00000002-00002 : 38 39 30
00000002-00003 : 0A
The -c option displays the character position of the first character
on each line.
$ xdump -c 10 data
0000000001 : 31 32 33 34 35 36 37 38 39 30 <- 1st character
0000000011 : 31 32 33 34 35 36 37 38 39 30 <- 11th character
0000000021 : 0A <- 21st character
The -n option displays all characters on the same line until it
encounters a linefeed (0A).
If this is specifed, <n>... is ignored.
$ cat data2
abc
12345
$ xdump -n data2
61 62 63 0A
31 32 33 34 35 0A