Linux Learning----Basics (shell, command, and VI use)

Source: Internet
Author: User

1, Shell 1.1, Introduction

The shell is meant to mean "shell", a "shell" program that surrounds the Linux kernel, and all the tasks that the user completes on the operating system are implemented through the interaction of the shell with the Linux system kernel.

In addition to the default Bourne again Shell (bash) under Linux, there are many other shells, such as C Shell (csh), Korn Shell (ksh), Bourne shell (SH), and Tenex C Shell (tcsh). Each version of the shell functions basically the same, and now the Linux system distribution is generally used bash as the default shell.

In order to speed up the operation of the command and to more effectively customize the shell, the shell defines some built-in commands, which are generally called built-in commands, such as CD, PWD, exit, and Echo commands, which are built-in commands that are part of Bash's commands.

In addition to the built-in commands, there are many executable files on the Linux system that can also be executed as shell commands. In fact, many of the commands on Linux are not Shell's built-in commands, such as LS is an executable file, stored in the/bin/ls. These commands are different from the shell built-in commands, and are only loaded by the system when they are called.

The shell performs the command interpretation in the following way: After the user has entered a command at the command line, the shell program first detects if it is a built-in command, and if it does, interprets the command as a system call through an interpreter inside the shell and submits it to the kernel for execution, if not the shell built-in command. Then the shell will follow the path given by the user or according to the configuration information of the system environment variable to find the corresponding command on the hard disk, then call it into memory, and then interpret it as a system invocation, commit to the kernel execution.

1.2. Shell Basic syntax

1.2.1, Shell command general format

After the user logs on to the system, the shell command line starts. The shell follows a certain syntax format to parse and interpret the commands entered by the user and pass them to the system kernel. The general format of the shell command is:

----- arguments: Command parameter # on the command line, the option is a code that contains one or more letters, mainly used to change the way the command is executed, typically there is a "-" in front of the optionto distinguish the parameters

According to Custom, we generally refer to the string with the above format as the command line. The command line is the basic unit of the dialog between the user and the shell.

Wildcard characters in the 1.2.2, shell

Wildcards are primarily intended to facilitate user-friendly descriptions of files or directories, such as when a user simply needs a file that ends with ". Sh", which can be easily implemented using wildcards. Each version of the shell has wildcards, which are special characters that users can use in the command-line parameters to match the file name or pathname.

    • "*": matches any one or more characters
    • “?” : Matches any single character
    • "[]": matches any single character that is contained within square brackets

For example:

ls *. SH  ls ?. SH  ls [xyz]. SH # matches files with file name x.sh or y.sh or z.sh

Linux Learning----Basics (shell, command, and VI use)

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.