What if you changed your binary files into text representations?
Use something like od ...

You'd have difficulty spotting all 'FFD9's in the file, as some might be
wrapped accross two lines ...

Truncate using dd ...

-jim

On Thu, 2004-01-15 at 12:37, Nick Rout wrote:
> (astute readers who do not delete my posts as a matter of course will
> see the relevance of this to my undelete thread ;-)
> 
> 1. grep -b is supposed to give me byte offsets into the file where the
> pattern occurs.
> 
> however:
> 
> sf root # egrep Exif -b /dev/hdb3
> Binary file /dev/hdb3 matches 
> 
> no byte offsets. why?
> 
> 2. how do i use grep to find a hex pattern, eg FFD9 (which marks the end
> of a jpeg file). I guess I have to escape it somehow, can  anyone tell
> me? (sorry i feel i should know this one, but i don't)
> 
> 3. how do i truncate a file to n bytes long? I thought there was a
> truncate command, but I may have the wrong name.

Reply via email to