CentOS command syntax structure

Source: Internet
Author: User
[Tyang3 @ localhostDesktop] $ command [-options] [arguments]

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

Command option parameters

Command:Indicates the command name, such as ls, cd, and cp.

Options:Defines the execution features of commands. the scratch sign [] does not exist in the actual commands of the marker. when you add option settings, the option usually includes a minus sign or a minus sign, there are two length options

Short options:Use-pilot, followed by a single character, such as-a,-l,-h, etc.

Multiple short options can be used in combination, with the same effect as several short options, such as-a-l-h =-alh

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

Arguments parameters:Indicates the target object of a command. it can have multiple parameters, usually the file name, directory, or user name.

 

Description 1: The first input in a command is either "command" or "executable file 』

Note 2: Commands, options, parameters, and so on are distinguished by spaces in the middle. shell rules are one cell regardless of the number of spaces.


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

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

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


These three commands have the same effect.

Note 3: When the command is too long, you can use a backslash (\) to skip the [Enter] symbol to make the Command continue to the next line. Note! After the backslash, it is immediately followed by special characters before the escape!

Note 4: In Linux systems, English letters are case sensitive, such as cd and CD.

2. help Command 1. whatis : Display brief function description

[Tyang3 @ localhost Desktop] $ whatis ls
Ls (1)-list directory contents
Ls (1 p)-list directory contents

 

2. -- Help: displays the usage summary and parameter list (you can view 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.
-A, -- almost-all do not list implied. and ..
-- Author with-l, print the author of each file

3. Man [ ] : View the command description or Manual page (Manual)

[Tyang3 @ localhost Desktop] $ man ls



Run the following command in man mode: Enter
/ Search for keywords
N/N next/Last
Q exit
Man-k List the manual pages that contain keyword keywords

4. Info : View more detailed instructions on commands

[Tyang3 @ localhost ~] $ Info ls


Note: info is more detailed than man, that is, dividing man's page into smaller chapters. at the same time, this command can also be linked to similar topics.


Info command baseline mode:
PageUp. pageDown paging
Tab jumps to the next link (where there is)
Enter
N/p/u jump to the next (previous) section and the previous chapter
S [ ] Search for keywords
Q exit

When you view the command help, symbols such as [], <>, | are displayed. their meanings are as follows:
[] Indicates that it is optional;
<> It indicates that it is changeable;
X | y | z indicates that onlySelectOne;
-Abc indicates the mixed use of three parameters (or any two parameters)


Usr/share/doc/description file directory
Http://www.redhat.com/docs/ online instructions

Related Article

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.