Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I ran hexdump command without parameter and my ubuntu machine froze... What did I do? What does this command do without parameter?

And what is it useful for?

share|improve this question
    
Were you running in text-only mode? I don't think your machine froze. –  Camilo Martin Jul 10 at 7:45
add comment

2 Answers 2

up vote 3 down vote accepted

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?

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.