The output option you chose will take 2 bytes and display the result as an octal number.
So your starts with the digit 1
and the character \n
. We can see this easier with od -cx
:
% od -cx f
0000000 1 \n 2 \n 3 \n 4 \n 5 \n 6 \n 7 \n 8 \n
0a31 0a32 0a33 0a34 0a35 0a36 0a37 0a38
0000020 9 \n
0a39
0000022
With your od -to2
it will take those 2 characters and treat them as a 'low byte, high byte' of a 16bit number.
So the number works out to 10*256+49 (the \n
is ASCII 10, and is the high byte; the 1
is ASCII 49 and is the low byte). That sum is 2609.
2609, in octal, is 005061 - which is the first number in your output. (In hex it's a31, which also matches the od -cx
output).
So this is what you're seeing; od is converting your input into 16 bit integers and displaying them in octal.