3

In OpenVMS the DUMP command:

Displays the contents of a file, a directory, a disk volume, a magnetic tape volume, or a CD-ROM volume in decimal, hexadecimal, octal format, ASCII, or formatted data structures.

This is frequently used when a file is not a simple text file where the content has a mixture of data types such as strings and integers.

What is the Unix/Linux command for this?

CW Holeman II
  • 3,654
  • 5
  • 31
  • 49

1 Answers1

6

There's a few options.

  • od should be available on POSIX systems, so most Unix and Linux variants will have it. That command has a slew of options to control the output format.
  • hexdump (from util-linux on my distro) is my favorite for a quick inspection (hexdump -C), but it's not available everywhere.
  • xxd (installed with Vim) is great too - especially since it allows you to convert to a human-readable hex format, and to convert back to binary. So that gives you a pretty simple hex editor.
Mat
  • 51,578
  • 10
  • 158
  • 140
  • +1 for xxd. It's not available everywhere, but that's the one you want to use. –  Oct 11 '12 at 15:12