Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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.
share|improve this answer
    
+1 for xxd. It's not available everywhere, but that's the one you want to use. –  Bruce Ediger Oct 11 '12 at 15:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.