Shell introduction and classification of Linux operating system

Source: Internet
Author: User
Tags aliases file system linux

What is a shell?

A shell is a special function program that is a interface between the core program (kernel) of the user and the Unix/linux operating system. Why do we say that the shell is an intermediary between the system's core program and its users? Readers who have read the introduction of operating systems know that the operating system is a system Resource manager and assigns, when you have needs, you have to put forward to the system, from the operating system point of view, it must also prevent the user from the wrong operation caused by the system damage? As we all know, the command to the computer commands or programs (Programs), the program has a compiler (compiler) to convert the program into binary code, but the order? In fact, the shell is also a program, it by the input device read the command, and then convert it to the computer can understand the mechanical code, and then execute it.

Each operating system has its own shell, and in DOS, for example, its shell is the Command.com file. As with the DOS Ndos,4dos,drdos and other command interpreter can replace the standard Command.com, UNIX, in addition to the Bourne Shell (/bin/sh) outside the C shell (/bin/csh), Korn Shell (/ Bin/ksh), Bourne again Shell (/bin/bash), Tenex C shell (tcsh) ... and other shells. Unix/linux the shell outside of the core program, making it a normal application that can modify, update, or add new functionality without affecting the operating system itself.

Activation of the Shell

When the system is started, the core program is loaded with memory, which is responsible for managing the system until the system shuts down. It establishes and controls the handler, manages the memory, the file system, the communication and so on. Other programs, including shell programs, are stored on disk. The core program loads them into memory, executes them, and cleans up the system after they abort. The shell is a utility that is started when you check it in. By interpreting the user-entered command (by command line or command file), the shell provides the user and core program with the ability to talk.

When you check in (login), a talking shell follows the start and prompts you to enter the command. After you type a command, then the shell works, and it does:

1. Syntax Analysis command column.

2. Processing of universal characters (wildcards), Steering (redirection), pipelines (pipes) and job control (job controls).

3. Search and execute orders.

When you first start learning the Unix/linux system, most of your time will be spent executing commands under the hint symbol (prompt).

If you often enter a set of commands in the same form, you may want to automate those tasks. So, you can put some commands into a file (called a command file, script), and then execute the file. A shell command file is much like a DOS batch file (such as Autoexec.bat): It stores a series of UNIX commands in a file and then executes the file. The more mature command file also supports the control structure of several modern programming languages, such as conditional judgment, circulation, file testing, transmission parameters, etc. To write a command file, not only to learn the structure and skills of programming, but also to unix/linux common procedures and how to operate need to have in-depth understanding. Some utilities are very powerful (such as grep, SED, and awk) and are often used in command files to manipulate command output and files. Once you become familiar with the tools and programming structures, you can start writing command files. When commands are executed by the command file, you are now using the shell as a program language.

To dwell on the Shell's life

The first significant, standard Unix shell was V7 (At&t's seventh edition) UNIX, which was presented at the end of 1979 and named after its creator, Stephen Bourne. The Bourne shell is designed based on the language of Algol, and is mainly used for automated system management. Although the Bourne shell is popular for simplicity and speed, it lacks many of the features of conversational use, such as history, aliases, and job control.

The C shell was developed at the end of the 70 by the University of California, Berkeley, and was distributed as part of the 2BSD UNIX. The shell, written primarily by Bill Joy, offers additional features that are not visible to the standard Bourne shell. C Shell is based on the C program language, and it is used to share similar syntax when programming languages. It also provides improvements in conversational usage, such as command-line history, aliases, and job control. Because the C shell was designed on a large machine and added some extra functionality, the C shell was slow to run on a small machine, even on a large machine compared to the Bourne shell.

With the Bourne shell and the C shell, UNIX users have a choice and argue that the shell is better. At&t's David Korn invented the Korn shell in the middle of the 80, which was released in 1986 and became an official part of SVR4 UNIX in 1988. The Korn shell is actually a superset of the Bourne shell and can be performed not only on UNIX systems but also on OS/2, VMS, and DOS. It provides the ability to be compatible with the Bourne shell and adds many popular features on the C shell, with increased speed and efficiency. Korn Shell has undergone many revisions to find out which version you are using to press the CTRL-V key under the KSH hint symbol.

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.