Popular Science-The meaning of "od -t oCc /etc/issue" in Bird Brother's private kitchen

Article excerpt display

insert image description here

It is confusing to see here, after all, there is no oCc format written here

Since the article can’t find the answer, let’s look at the detailed description (man od)
as shown in the figure, presumably we should be very clear, the parameter oC corresponding to o[size] can explain well The
meaning here is to show that each Bit octal is displayed by sizeof©
insert image description here
Through sizeof(char) in c language, we can see that the output is 1
The code is as follows
insert image description here
Execute through the gcc command

gcc test.c -o a.out 
./a.out 

We can see the following execution results
insert image description here
, so the output of our first line is output in octal, each octal occupies a digit, and the c parameter, which is the second line we see in the result, is in accordance with the character output

Knowing the above logic, we can look at the following commands in the test

od -t o2c /etc/issue 

You can see the following results.
insert image description here
You can get the octal represented by every two digits. We convert the decimal value through calculation to 46 *2 = 83. The
S character represented by the sizeof(char) corresponds to o(123) = 83

Guess you like

Origin blog.csdn.net/weixin_39370315/article/details/128119085