[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17367: od command not working correctly ?
From: |
Pádraig Brady |
Subject: |
bug#17367: od command not working correctly ? |
Date: |
Tue, 29 Apr 2014 09:44:43 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
tag 17367 notabug
close 17367
stop
On 04/29/2014 07:20 AM, Dieter Walz wrote:
> Hi,
> I've got a problem with od command; could anyone check, please?
>
> After editing and saving a file ...
> address@hidden ~]$ cat temp.txt
> a1
> b2
> c3
> ... I wanted to browse it in hex mode by use of 'od' command, however I
> failed
> to obtain a correct image:
>
> address@hidden ~]$ od -t x temp.txt
> 0000000 620a3161 33630a32 00000a0a
> 0000012
> address@hidden ~]$ od -t x2 temp.txt
> 0000000 3161 620a 0a32 3363 0a0a
> 0000012
> address@hidden ~]$ od -x temp.txt
> 0000000 3161 620a 0a32 3363 0a0a
> 0000012
> address@hidden ~]$
> using vi (hex mode) instead, I got what I expected ....
> 1: 6131 0a62 320a 6333 0a0a a1.b2.c3..
> Is there an error with od command or do I understand it badly?
I added EXAMPLES to the man page a while back,
which might be what you want:
od -A x -t x1z -v
Display hexdump format output
I notice the vi hex mode is using big endian 2 byte format.
If you do want that, you can get with the version of od in git like:
$ od --endian=big -Ax -t x2z -v temp.txt
000000 6131 0a62 320a 6333 0a00 >a1.b2.c3.<
Pádraig.