[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: octal dump



Ron Johnson wrote:
On 11/18/08 05:50, mike wrote:
Girish Kulkarni wrote:
Hello,

I was trying to understand octal dumps today that can be obtained
using od.  But two questions cropped up:

1. When would an octal dump be useful?  Surely not in perusing text
   files?!  And when people say they use octal (or hex) dump to check
   and edit binary files, how do they learn to do so?

2. I understand that od shows the file offsets in decimal if I say 'od
   -Ad'.  But I find that the offset of the last line does not match
   with the size of the file given by 'du -h'.  Why is that?

I really am puzzled after bumping into this command by chance.  Any
comments would help.

Thanks,
Girish.

In my work I collect a lot of data from the serial port, spit out by other machines. od is VERY useful when I collect data from a new machine. Are there carriage returns? Are there other strange characters?.... After those questions are answered it's much easier to parse the data and do stuff with it.

But do you do a pure od, or an "od -tx"?

I use od -c which puts ASCII chars and backslashes the rest. makes it easier to spot the funny chars.


Reply to: