Shell Review notes----commands and Parameters

Source: Internet
Author: User

The basic job of the shell is to execute commands.

The shell executes each command you type.

$CD work;ls-l whizprog.c

First: The format is simple, separating the various components of the command line with a blank Space key or TAB key.

Second, the command name is the first item in the command line. Usually followed by option, any additional parameters (argument) will be placed after the option

Third, the option starts with a dash (or minus sign) followed by a letter. Options are optional and may require parameters. Options that do not require parameters can be merged.

The long option is preceded by a dash or two dashes depending on the program. Two dashes (--) indicate the usage at the end of the option.

$ cd Whizprog-1.1$patch--verbose--backup-p1</tmp/whizprog-1.1-1.2-patch

Finally, a semicolon (;) can be used to split multiple commands in the same line. The shell executes the commands one at a time. If the & symbol is used instead of; the shell executes its previous command in the background, which means that the shell can proceed to the next command without waiting for the command to complete.

The shell recognizes three basic commands:

    • Built-in command: By the shell itself is executed by the name of science and technology.
    • Shell functions: A well-functioning set of program code, written in the shell language, that can be referenced like a command.
    • External command: An external command is a command executed by a copy of the shell (a new process), the basic process is as follows:
      • Establish a new process. This process is a replica of the shell.
      • In the new process, look for specific commands within the directory listed in the PATH variable.
        /bin:/usr/bin:/usr/x11r6/bin/usr/local/bin

        is a typical default value for the PATH variable. When the command contains a slash (/) symbol, the path lookup step is skimmed.

      • In the new process, replace the executing shell program with the new program found and execute it.
      • When the program is complete, the original shell will then read the next command from the terminal, or execute the next command in the script.

Shell Review notes----commands and Parameters

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.