Sample Header Ad - 728x90

How to count the number of bytes in a file, grouping the same bytes?

5 votes
5 answers
2990 views
Example: I have the file "mybinaryfile", and the contents in hex are: A0 01 00 FF 77 01 77 01 A0 I need to know how many A0 bytes there are in this file, how many 01, and so on. The result could be: A0: 2 01: 3 00: 1 FF: 1 77: 2 Is there some way to make this count directly in shell or do I need to write a program in whatever language to do this specific task?
Asked by Lawrence (329 rep)
Jun 28, 2019, 04:50 PM
Last activity: Mar 31, 2020, 11:56 AM