OD (octal dump) command
The OD (octal dump) command can display files or streams in eight, decimal, hexadecimal, and ASCII formats, which are useful for accessing or visually inspecting characters in a file that cannot be displayed directly on the terminal, such as line breaks. In addition, empty locations can be viewed by OD commands in some empty files.
General use Format:
OD [-ABBCDDEFFHHIILLOOSVXX] [-A base] [-j Skip] [-N-length] [-t type] [[+]offset[.] [Bb]] [File ...]
For a simplified version:
OD [-A address into] [-t display format] file name
which
-A (address system) displays the address information according to the specified system;
-t specifies the format of the data display.
The address system specified by-a includes:
- O: Octal (System default)
- D: Decimal
- X: Hexadecimal
- N: Do not print offset values
-t The main parameters for the display format of the specified data are:
- C:ascii character or backslash sequence (e.g. \ n)
- D: Signed decimal digits
- F: Floating point numbers
- O: Octal (System default)
- U: Unsigned decimal digits
- x: Hexadecimal numbers
Example: displaying the contents of a file AA in ASCII form
slot@slot-ubt:~/test$ cat aa
Hello
world
slot@slot-ubt:~/test$
slot@slot-ubt:~/test$ od-tc aa
0000000 h e l l o \ n w o r l d \ n
0000014
slot@slot-ubt:~/test$
Show them in 16, octal, and decimal formats, respectively:
slot@slot-ubt:~/test$ od-tcx AA
0000000 h e l l o n w o r l d \ n
6c6c6568 6f770a6f 0a646c72
000 0014
slot@slot-ubt:~/test$
slot@slot-ubt:~/test$ od-tco aa
0000000 h e l l o \ n w o r l d \ n
15433062 15735605157 01231066162
0000014
slot@slot-ubt:~/test$ od-tcd aa
0000000 h e l l o \ n W o r L d \
1819043176 1870072431 174353522
0000014
slot@slot-ubt:~/test$
Hello world Each character corresponds to the 16 form is as follows:
0x680x650x6c0x6c0x6f
0x770x6f0x720x6c0x64
Summarize
The above is on the Linux View command of the OD command of all content, I hope this article on the content of everyone's study or work can bring certain help, if you have questions you can message exchange.