Find Positions of a Hexadecimal Sequence in a File

This page answers questions like these:

Find Positions of a Hexadecimal Sequence in a File:

od -v -t x1 FILE | sed 's/[^ ]* *//' | tr '\012' ' ' | grep -b -i -o HEXSTRING | sed 's/:.*/\/3/' | bc od -v -t x1 FILE | sed 's/[^ ]* *//' | tr '\012' ' ' | sed 's/HEXSTRING/FOUND\n&/g' | tr ' ' '\012' | grep -n FOUND | sed 's/\([^:]*\):.*/v=\1;d=d+1;v-d;/' | bc
Related Links:
Count Occurrences of a Hexadecimal Sequence in a File
Count Occurrences of a String in a File
Output the Lines Between Two Matching Lines
Output Lines of a File in Reverse Order
Replace Text in a File using the Command Line
Join Lines of Text File Together

Home  >  Linux / Unix  >  Find Positions of a Hexadecimal Sequence in a File


Tags: find, byte sequence, hexadecimal sequence, hex sequence, hexadecimal string, hex string, hexadecimal pattern, hex pattern, file, text file, binary file, linux, unix

Src: file-find-hexadecimal.txt
Dst: Linux-Unix/find-positions-of-hexadecimal-sequence-in-file.htm
Ads: 2