Manual Reference Pages  - mdump (1)


mdump - dump data from a binary file


See Also


mdump [options...]


mdump reads data from a specified input file or stdin and dumps data elements from it to a specified output file or stdout after formatting them as indicated. mdump may be either used as a replacement for od or to extract data from simple binary files without having to write a specialized program.

mdump may be obtained as part of the drm_tools package from:


-blocks <blocks>
  The number of data blocks to emit. 0 = all = default.

-dtype <data_type>
  Set the type of the data elements:
c = char
s = short int
l = (long) int (default)
g = long long (not available on all platforms)
f = float
d = double

-ds Emit data sizes and exit.

-flip Invert byte order. Default is to leave byte order as is.

-format <format_string>

<format_string> contains a C printf format string which controls the formatting of data elements. The syntax of this string is: %Width.PrecisionSpecifier. The C format Specifiers are: c (character); o (octal), x (hexadecimal); d (decimal), ll[d,u,o,x] long long variants; f (floating point); e (exponent). The valid format specifiers for each data type are:

dtype  Specifiers  Default
c      c,d,o,x     %c
s      d,o,x       %9d
l      d,o,x       %9d
g      ll[u,d,o,x] %18llu
f      f,e         %9e
d      f,e         %9e

-h -help --help -? --??
  Print the help message and exit.

-i Emit version, copyright, license and contact information and exit.

-in <input_file>
  Read input from the specified file. (Default is to read from stdin.)

-interval <interval>
  Set the number of data elements in each repeat block. Default is 1.

-multiple <multiple>
  The number of data elements to dump from each block (all to one line). Defaults to <interval>.

-offset <offset>
  Emit data elements starting at <offset> data elements from the beginning of the file. Default is 0.

-out <output_file>
  Write output to the specified file. (Default is to write to stdout.)

-show <show>
  Controls numbering of output lines. Positions are offsets relative to <offset>. That is, if <offset> is 5 then element 5 is shown with position 0. Options are:
0 do not number output lines (default)
1 number by bytes (hexadecimal)
2 number by data element (hexadecimal)
3 number by blocks (hexadecimal)
4 number by bytes (octal)
5 number by data element (octal)
6 number by blocks (octal)
7 number by bytes (decimal)
8 number by data element (decimal)
9 number by blocks (decimal)

  Default is for integer data elements to be unsigned. This flag makes them signed. Ignored for f , d , and g data types. To obtain signed output for g type use a format string like %18lld.


% mdump -h
  List the the command line options.

% mdump -dtype l -format ’ %8.8x’ -interval 4 -show 2 somefile
  Dump in hex format integer elements in blocks of 4 per line and number the lines by data block.

% echo ABCD | mdump -dtype c -format ’ %3.3o’ -interval 4 -blocks 1
  Emits the octal values for the four ascii characters ABCD.




GNU General Public License 2


Copyright (C) 2002, 2006 David Mathog and Caltech.


David Mathog, Biology Division, Caltech <>

drm_tools mdump (1) 1.0.5 OCT 23 2006
Generated by manServer 1.07 from /usr/common/man/man1/mdump.1 using man macros.