Big endian

From Linuxintro
Revision as of 11:34, 12 December 2010 by imported>ThorstenStaerk

Today I am experimenting with my big endian (PowerPC) machine

tstaerk@little:~> cat >test
hellö world
tstaerk@little:~> cat test
hellö world
tstaerk@little:~> hexdump test
0000000 6568 6c6c b6c3 7720 726f 646c 000a
000000d

OK, we have a file that contains the string "hellö world". We read the first byte and it is a "h":

tstaerk@little:~> dd if=test bs=1 count=1 | hexdump
0000000 0068
0000001
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.00075077 s, 1.3 kB/s

We read the second byte and it is an "e":

tstaerk@little:~> dd if=test bs=1 count=1 skip=1 | hexdump
1+0 records in
1+0 records out
1 byte (1 B) copied, 4.436e-05 s, 22.5 kB/s
0000000 0065
0000001