Get the App
SLTechnology News&Howtos  ›  Servers  › 

Use the od command of linux to output the file contents

Shulou Source: shulou.com Published: 2022-06-02 19:47:10 09月25日 Update

Today, what the editor shares with you is the use of linux's od command to output the contents of the file. I believe many people don't know much about it. In order to make you understand better, I summed up the following contents and looked down together. I'm sure you'll get something.

The od command reads the contents of the given file and renders its contents in octal code.

Syntax format: od [parameters]

Common parameters:

The effect of this parameter is the same as specifying the "- ta" parameter at the same time-A selecting the cardinality on which to calculate the word code-b the effect of this parameter is the same as specifying the "- toC" parameter-c the effect of this parameter is the same as specifying the "- tC" parameter at the same time-d the effect of this parameter is the same as specifying the "- tu2" parameter at the same time-f this parameter is the same as specifying the "- tfF" parameter at the same time- H the effect of this parameter is the same as specifying the "- tx2" parameter at the same time-I the effect of this parameter is the same as specifying the "- td2" parameter at the same time-j skipping the number of characters set-l the effect of this parameter is the same as specifying the "- td4" parameter-N to the number of characters set-o the effect of this parameter is the same as specifying the "- to2" parameter-s shows only the number of characters that match the specified number of characters String-t set output format-v output without omitting duplicate data-w sets the maximum number of characters per column-x the effect of this parameter is the same as specifying the "- h" parameter at the same time-- help view help information-- version display version information

Reference example

Create a tmp file:

[root@linuxcool ~] # echo abcdef g > tmp [root@linuxcool ~] # cat tmp

Use the od command:

[root@linuxcool] # od-b tmp

Use a single-byte octal interpretation for output, and note that the default address format on the left is eight bytes:

[root@linuxcool ~] # od-c tmp

Use the ASCII code for output, and note that escape characters are included:

[root@linuxcool] # od-t D1 tmp

Explain using single-byte decimal:

[root@linuxcool ~] # od-A d-c tmp on the use of linux od command output file content is shared here, I hope the above content can have a certain reference value for everyone, you can learn to apply. If you like this article, you might as well share it for more people to see.

Tags: Parameters same effect and same content output character command file byte number format information octal code reference interpretation maximum learning for application value Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Tech Info vpn Apple Redmi