Get the App
SLTechnology News&Howtos  ›  Servers  › 

The usage of the Linux basic command od

Shulou Source: shulou.com Published: 2022-06-01 12:48:05 11月10日 Update

This article introduces the relevant knowledge of "the usage of the Linux basic command od". Many people will encounter such a dilemma in the operation of actual cases, 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!

Od

Displays the contents of the specified file in octal, decimal, hexadecimal, and so on. The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Od [options] file

Od [- abcdfilosx]... [FILE] [[+] OFFSET [.] [b]]

Od-- traditional [OPTION]... [FILE] [[+] OFFSET [.] [b] [+] [LABEL] [.] [b]]

2. List of options

Option

Description

-- version

Display command version information

-- help

Show help documentation

-A |-- address-radix=RADIX

Sets the coding unit of the offset

-j |-- skip-bytes=BYTES

Skip the characters of the specified title

-N |-- read-bytes=BYTES

Output specified number of characters

-S |-- strings [= BYTES]

Output a string of at least BYTES graphic characters

-t |-- format=TYPE

Specify output format

-w |-- width [= BYTES]

Set the maximum number of words per line

-v |-- output-duplicates

Display duplicate data

-- traditional

Accept the traditional form of parameters

3. Examples

1) display content in octal

[root@localhost weijie] # cat 3.c / / View content

12345

2334

two hundred and twelve

[root@localhost weijie] # od 3.c / / display in octal

0000000 031061 032063 005065 031462 032063 031012 031061 000012

0000017

2) display the content in character form

[root@localhost weijie] # cat 1.c / / View content

Hello world

I am david.

I love linux

Love code.

[root@localhost weijie] # od-t c 1.c / / is displayed in character format

0000000 h e l l o w o r l d,\ n I

0000020 a m d a v i d. \ n i l o v

0000040 e l i n u x,\ n l o v e c

0000060 o d e. \ n

0000065

This is the end of the introduction to "the usage of the Linux basic command od". 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!

Tags: Content characters commands methods output octal basic more knowledge coding practical maximum learning next line bibliography tradition information hexadecimal decimal Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Microsoft NVidia Apple Xiaomi