Linux Shell Introduction

Source: Internet
Author: User
Tags posix

1. What is a shell?

The shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the command entered by the user and feeds it into the kernel to execute.

In fact, the shell is a command interpreter that interprets the commands entered by the user and sends them to the kernel.


2.shell Type2.1 Bourne Shell (short, SH)

The first important standard UNIX shell was introduced at the end of 1970 at V7 Unix (7th edition), and with its founding foundation conditions platform "National Meteorological Network Computing application Node Building" (2004dka50730) Sponsor Stephen Named after the Bourne's name. The Bourne shell is a switch-type command interpreter and command programming language. The Bourne shell can be run as either the login shell or the login Shell's Child shell (Subshell). Only the login command can invoke the Bourne shell as a login shell. At this point, the shell reads the/etc/profile file and the $home/.profile file first. /etc/profile files are custom environments for all users, $HOME/.profile files for this user-defined environment. Finally, the shell waits for your input to be read.


2.2 C Shell (abbreviation, CSH)

Bill Joy developed the C shell at the University of California in Berkeley in the early the 1980s. It is primarily intended to make it easier for users to use interactive features and to turn the grammatical structure of the ALGOL style into a C language style. It adds features such as command history, aliases, file name substitution, job control, and more.


2.3 Korn Shell (abbreviated, KSH)

For a long time, there were only two types of shells for people to choose from, Bourne shell for programming, and C shell for interaction. To change the situation, the Bell lab David Korn developed the Korn shell. Ksh combines all of the C Shell's interactive features and incorporates the syntax of the Bourne shell. As a result, Korn shell is popular with users. It also adds features such as mathematical calculations, process collaboration (coprocess), inline editing (editing), and more. Korn Shell is an interactive command interpreter and command programming language. It conforms to the international standard of posix--an operating system. POSIX is not an operating system, but a standard that targets the portability of applications-across multiple platforms at the source program level.


2.3 Bourne Again Shell (for short, bash)

Bash is part of the GNU program to replace the Bourne shell. It is used for GNU-based systems such as Linux. Most Linux (Red Hat,slackware,caldera) uses bash as the default shell, and when it runs SH, it actually calls bash.


2.4 POSIX Shell (abbreviation, PSH)

The POSIX shell is a variant of the Korn shell. The largest vendor currently providing POSIX shells is Hewlett-Packard. The HP-UX 11.0,posix Shell is/bin/sh, and BSH is/usr/old/bin/sh.

The default shell for each major operating system:

    • Under Aix is Korn Shell
    • Solaris, the default is the Bourne shell
    • The FreeBSD default is C shell
    • The default for HP-UX is the POSIX shell
    • Linux is Bourne Again Shell


3. What shell scripts?

Shell scripts are similar to batches under Windows/dos, a text file that contains a sequence of commands.


What is the difference between 4.shell and shell scripts?

Shell:shell is a command parser

The Shell:shell script is a text file that contains a sequence of commands


Note: Organized from the network

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.