Introduction to the Shell under Linux

Source: Internet
Author: User

?

I. Overview

After the successful landing of Linux, the system will appear different cue symbols, such as $,~, #等, and then you can start to enter the required commands. If the command is correct, the system will be executed according to the requirements of the command, until the system is logged off, each command entered will be interpreted and executed during login and logoff, and the responsible mechanism is the shell

?

Second, the execution process of the shell under Linux

The shell can be understood as a function block for parsing Linux commands, equivalent to a bat batch file under Windows, for example: Create a new Del.bat file under the Windows desktop, open and edit the command del e:\ Test.txt, create a new test.txt in the E-drive directory, double-click Del.bat after the Test.txt file is deleted.

Three, Shell programming

In fact, as the command language interactive interpretation and execution of user input commands is only one aspect of the shell function, the shell can also be used for programming, it provides the means to define variables and parameters and a rich program control structure. Using shell programming is similar to a batch file in DOS, called shell script, or shell or shell command files.

Interested friends can take a look at "Linux command, editor and Shell programming" this book, as well as a beginner's starter document "Linux and Unix Shell Programming Guide", online downloadable

?

Iv. Classification of shells

    • There are a lot of shells, but there are several common

Shell name???? Developers???????? Command name

Bourne???????? S.r.bourne???? /bin/sh

C???????? Bill Joy???????? /bin/csh

Kom???????? David???????? /bin/ksh

    • View the SH owned by the system

#ls –l/bin/*sh

???? Note:l start with a shortcut to the file, China is accustomed to bash, European customary with Ksh

???? /BIN/CSH???? Just want to

?

    • See what kind of shell is currently in use

?

#env | more???? Note: This command can display the environment variables for the current operating system

?

?

    • Modify Shell

      #chsh –s Enter a new shell???? such as:/bin/dash

Replace the shell after logout, and then log in, and find that the dash command prompt starts with #

Logout command not recognized at Dash, need to use exit

?

V. Incomplete functions of SHELL commands

When you enter a command, the user does not need to enter the complete command, and the system automatically finds the name that best matches it. This feature saves time when you frequently enter commands.

For example: Direct input "MK"---and then press the "tab" key---will search for the two letter "MK" command.

????

???? Enter the cat my---and press the TAB key twice---will search for all files or directories that begin with the letter "my" in the current directory s

????

?????

?

?

?

?

?

?

?

?

?

?

?

?

?

Introduction to the Shell under Linux

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.