Linux view commands in the OD command detailed _linux

Source: Internet
Author: User

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:

    1. O: Octal (System default)
    2. D: Decimal
    3. X: Hexadecimal
    4. N: Do not print offset values

-t The main parameters for the display format of the specified data are:

    1. C:ascii character or backslash sequence (e.g. \ n)
    2. D: Signed decimal digits
    3. F: Floating point numbers
    4. O: Octal (System default)
    5. U: Unsigned decimal digits
    6. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.