Forrest logo
back to the hexdump tool

hexdump:tldr:dd557

hexdump: Display the hexadecimal representation of a file, but interpret only n bytes of the input.
$ hexdump -C -n${number_of_bytes} ${filename}
try on your machine

The command "hexdump -C -n${number_of_bytes} ${filename}" is used to display the hexadecimal and ASCII representation of binary data in a file.

Here's what each option and argument in the command does:

  • "hexdump" is the actual command that runs the hexdump utility.
  • "-C" is an option that tells hexdump to display the output in a specific format. It adds an ASCII representation of the hexdump output on the right side. The ASCII representation is shown only if the corresponding hexadecimal value is a printable character.
  • "-n${number_of_bytes}" is an option followed by an argument. "-n" tells hexdump to read only a specific number of bytes from the file. ${number_of_bytes} is a placeholder for the actual number of bytes you want to read.
  • ${filename} is an argument indicating the file from which you want to read the binary data.

By running this command, you will get a hexadecimal dump of the specified file, along with the corresponding ASCII characters if they are printable. The output will show the offset, hexadecimal values, and ASCII representation of the binary data.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hexdump tool