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

Example Analysis of the Syntax structure of CentOS instruction

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

The editor will share with you an example analysis of the syntax structure of CentOS instructions. I hope you will gain something after reading this article. Let's discuss it together.

[tyang3@localhost Desktop] $command [- options] [arguments]

Instruction option parameter

Command command: indicates the name of the command, such as ls, cd, cp, etc.

Options option: defines the execution characteristics of the command. The scraper [] does not exist in the actual instruction, but when adding the option setting, the option is usually preceded by a-sign or-- sign, and there are two short and long options.

Short option: use-boot, followed by a single character, such as-a,-l,-h, etc.

Multiple short options can be combined to have the same effect as several short options, such as-a-l-h===-alh

Long options: use-- guide, followed by complete words, such as-help

Arguments parameter: represents the object of the command, which can have multiple parameters, usually a file name, directory, or user name.

Description 1: the first input part of the instruction is definitely "command" or "executable file"

Description 2: commands, options, parameters and so on are distinguished by spaces in the middle. No matter how many spaces are empty, the shell is defined as one.

[tyang3@localhost Desktop] $ls-al / etc

[tyang3@localhost Desktop] $ls-al / etc

[tyang3@localhost Desktop] $ls-a-l / etc

These three commands have exactly the same effect.

Explanation 3: when the instruction is too long, you can use the backslash (\) to jump out of the [Enter] symbol to keep the instruction running to the next line. Be careful! Immediately after the backslash, you can get rid of the special characters.

Description 4: in Linux systems, strict distinction between the case of the English alphabet, such as cd and CD are different

Help command 1. Whatis: display a short description of the function

[tyang3@localhost Desktop] $whatis ls

Ls (1)-list directory contents

Ls (1p)-list directory contents

2.-- help: displays a summary of usage and a list of parameters (you can see the usage of most commands)

[tyang3@localhost Desktop] $ls-- help

Usage: ls [OPTION]... [FILE]...

List information about the FILEs (the current directory by default).

Sort entries alphabetically if none of-cftuvSUX nor-sort.

Mandatory arguments to long options are mandatory for short options too.

-a,-all do not ignore entries starting with.

-A-- almost-all do not list implied. And..

-- author with-l, print the author of each file

3. Man []: view command description or man page (Manual)

[tyang3@localhost Desktop] $man ls

Bottom line mode under the man command: enter

/ find keyword

N next / previous one

Q leave

Man-k lists man pages that contain the keyword keyword

4. Info: view more detailed documentation of the command

[tyang3@localhost ~] $info ls

Note: info looks at a more detailed description than man, that is, subdividing the man page into smaller chapters, and this command can also be linked to similar topics

Info command bottom line mode:

PageUp.pageDown page flip

Tab jumps to the next link (where there is *)

Enter enter the link

N/p/u jumps to the next (previous) section, the previous chapter

S [] find keywords

Q leave

When viewing the command help, symbols such as [], |, and so on appear. Their meanings are as follows:

[] indicates that it is optional

Indicates that it is changeable.

X | y | z means only one can be selected

-abc indicates the mixed use of three parameters (or any two)

Usr/share/doc/ description file directory

Http://www.redhat.com/docs/ online documentation

After reading this article, I believe you have some understanding of "sample Analysis of the grammatical structure of CentOS instructions". If you want to know more about it, please follow the industry information channel. Thank you for reading!

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

Servers

Wechat

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

12
Report