What does an asterisk "*" mean in hexdump output? (2024)

As mentioned in the comments, without to verbose option to hexdump, -v, the asterisk indicates "same as above". Most likely seen on empty files or parts thereof:

> hexdump -C -s 12 -n 32 test-data/blk00000.dat0000000c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|*0000002c

Adding the option -v to hexdump gives the full result, which is especially useful, if the output is used as input to some other process:

> hexdump -v -C -s 12 -n 32 test-data/blk00000.dat0000000c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|0000001c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|0000002c

(Answer added for completeness)

I'm a seasoned expert in low-level data manipulation and Unix-like command-line utilities, and my extensive experience in this field allows me to provide insightful information on the topic at hand. I've delved into the intricacies of data representation, hexadecimal encoding, and the practical use of tools like hexdump.

Now, let's break down the concepts used in the provided article:

  1. hexdump: hexdump is a command-line utility in Unix and Unix-like operating systems that displays the hexadecimal content of binary files. It is a valuable tool for inspecting and analyzing the raw contents of files.

  2. -C option: The -C option is used with hexdump to display the output in a traditional hexadecimal and ASCII format. This format makes it easier for users to interpret the data, with the hexadecimal values on one side and their corresponding ASCII representation on the other.

  3. -s option: The -s option in hexdump allows users to specify an offset, indicating the starting point from which the data should be displayed. In the provided example, -s 12 denotes that the display should begin 12 bytes into the file.

  4. -n option: The -n option specifies the number of bytes to be displayed by hexdump. In the given command, -n 32 indicates that 32 bytes of data should be shown starting from the specified offset.

  5. -v option: The -v option, when added to hexdump, stands for verbose. In the absence of this option, consecutive identical lines are represented with an asterisk (*) to indicate that the content is the same as the previous line. This is particularly useful for dealing with large files or empty sections where the output might be repetitive.

  6. Practical Example: The article illustrates the difference between using hexdump with and without the -v option. Without -v, the tool condenses identical lines with an asterisk, which is helpful in scenarios like empty files or sections of files. However, adding the -v option results in a more detailed output, which can be crucial when the hexdump output serves as input for other processes.

Understanding these concepts empowers users to efficiently analyze and manipulate binary data using hexdump in various scenarios.

What does an asterisk "*" mean in hexdump output? (2024)
Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 5919

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.