This is from man hexdump:
The hexdump utility is a filter which displays the specified files, or the standard input, if no files are specified, in a user specified format.
In short, it transforms text from one format to another. Traditionally, hexdump is mostly used for debugging, especially programs that are using low-level libraries.
But now with unicode, I sometimes use it to get different values of characters or to transform lines or files.
Because it is a filter, you send text into it. An easy way to do this is with the pipe operator (|).
It outputs the text displayed as either ASCII, decimal, hex, or octal. You use format specifiers to determine the output. These are command options you put after the hexdump.
If you want to see the results on the command line you need to start off with echo.
So it's echo text-to-transform | hexdump options optional-format-specifiers
An example from the man page is:
echo hello | hexdump -v -e '/1 "%02X\n"'
which outputs the hex value of each letter.
This example may not seem useful but remember it's possible to recode entire files or dump contents of memory in a human readable form.
If you don't send input to hexdump, it keeps waiting and appears to do nothing. This is what would happen if you ran hexdump by itself. When you say it froze, did more than that happen?
It prints data in human readable format, typically hexadecimal. Like most unix commands, without any arguments it reads the data on stdin and writes to stdout, so if you didn't redirect stdin, then it is simply waiting for you to type some data into the terminal. The computer is not frozen, only the command is waiting for input. You can interrupt the command with Ctrl-C, or Ctrl-D indicates the end of input.
hexdump -C does what you want.
# hexdump -C /etc/passwd
00000000 72 6f 6f 74 3a 78 3a 30 3a 30 3a 72 6f 6f 74 3a |root:x:0:0:root:|
00000010 2f 72 6f 6f 74 3a 2f 62 69 6e 2f 62 61 73 68 0a |/root:/bin/bash.|
00000020 64 61 65 6d 6f 6e 3a 78 3a 31 3a 31 3a 64 61 65 |daemon:x:1:1:dae|
00000030 6d 6f 6e 3a 2f 75 73 72 2f 73 62 69 6e 3a 2f 62 |mon:/usr/sbin:/b|
00000040 69 6e 2f 73 68 0a 62 69 6e 3a 78 3a 32 3a 32 3a |in/sh.bin:x:2:2:|
00000050 62 69 6e 3a 2f 62 69 6e 3a 2f 62 69 6e 2f 73 68 |bin:/bin:/bin/sh|
...
The vim editor usually (?) includes the tool xxd.
$ xxd `which xxd` | head -n 10
0000000: 7f45 4c46 0201 0100 0000 0000 0000 0000 .ELF............
0000010: 0200 3e00 0100 0000 400a 4000 0000 0000 ..>.....@.@.....
0000020: 4000 0000 0000 0000 f035 0000 0000 0000 @........5......
0000030: 0000 0000 4000 3800 0800 4000 1b00 1a00 ....@.8...@.....
0000040: 0600 0000 0500 0000 4000 0000 0000 0000 ........@.......
0000050: 4000 4000 0000 0000 4000 4000 0000 0000 @.@.....@.@.....
0000060: c001 0000 0000 0000 c001 0000 0000 0000 ................
0000070: 0800 0000 0000 0000 0300 0000 0400 0000 ................
0000080: 0002 0000 0000 0000 0002 4000 0000 0000 ..........@.....
0000090: 0002 4000 0000 0000 1c00 0000 0000 0000 ..@.............