Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the od command of Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to use the od command of Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

In the Linux system, the od command is mainly used to output the contents of the file. After executing the command, the contents of the given file will be read and presented in octal code.

Syntax od [- abcdfhilovx] [- A] [- j] [- N] [- s] [- t] [- w] [--help] [--version] [file.] Parameter:-a this parameter has the same effect as specifying the "- ta" parameter at the same time.

-A chooses what cardinality to calculate the word code.

-b the effect of this parameter is the same as specifying the "- toC" parameter at the same time.

-c the effect of this parameter is the same as specifying the "- tC" parameter at the same time.

-d this parameter has the same effect as specifying the "- tu2" parameter at the same time.

-f this parameter has the same effect as specifying the "- tfF" parameter at the same time.

-h this parameter has the same effect as specifying the "- tx2" parameter at the same time.

-I this parameter has the same effect as specifying the "- td2" parameter at the same time.

The number of characters set by-j or-skip-bytes= skipped.

-l this parameter has the same effect as specifying the "- td4" parameter at the same time.

-N or-read-bytes= up to the set number of characters.

-o this parameter has the same effect as specifying the "- to2" parameter at the same time.

-s or-strings= displays only strings that match the specified number of characters.

-t or-format= sets the output format.

Duplicate data is not omitted when-v or-output-duplicates is output.

-w or-width= 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 online help.

-version displays version information.

Case demonstration: [linuxde@localhost ~] $echo abcdef g > tmp [linuxde@localhost ~] $cat tmp abcdef g description: prepare a tmp file first

[linuxde@localhost ~] $od-b tmp 0000000 1414414414440147012 0000011 description: use single-byte octal interpretation for output. Note that the default address format on the left is eight bytes.

[linuxde@localhost ~] $od-c tmp 0000000 a b c de f g\ n 0000011 description: use ASCII code for output, note that escape characters are included

[linuxde@localhost ~] $od-t D1 tmp 0000000 97 98 99 101 102 32 103 10 0000011 description: explain using single byte decimal

[linuxde@localhost ~] $od-AD-c tmp 0000000 a b c de f g\ n 0000009 description: set the address format to decimal.

[linuxde@localhost ~] $od-A x-c tmp 000000 a b c de f g\ n 000009 description: set address format to hexadecimal

[linuxde@localhost] $od-j 2-c tmp 0000002 c de f g\ n 0000011 description: skip the first two bytes

[linuxde@localhost ~] $od-N 2-j 2-c tmp 0000002 c d 0000004 description: skip the first two bytes and output only two bytes

[linuxde@localhost] $od-W1-c tmp 0000000 a 0000001 b 0000002 c 0000003 d 0000004 e 0000005 f 0000006 0000007 g 0000010\ n0000011 description: output only 1 byte per line

[linuxde@localhost] $od-W2-c tmp 0000000 a b 0000002 c d 0000004 e f 0000006 g 0000010\ n0000011 description: output two bytes per line

[linuxde@localhost] $od-W3-b tmp 0000000 1411443 0000003 141441460000006 040147012 0000011 "how to use the od command of Linux" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report