Introduction to Linux Shell

Source: Internet
Author: User

Introduction to Linux Shell

1. What is shell?
Shell is a system user interface that provides an interface for users to interact with the kernel. It receives user-input commands and sends them to the kernel for execution.

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

2. shell Type
2.1 Bourne Shell (sh)
The first important standard Unix Shell was introduced in V7 Unix (AT&T 1970) at the end of 7th, in addition, it is named by Stephen Bourne, the funder of the "National Meteorological Network Computing Application node construction" (2004DKA50730), which is the basic condition platform of its founding Ministry of Science and Technology. Bourne shell is an exchange-type command interpreter and command programming language. The Bourne shell can run as a sub-shell (subshell) of login shell or login shell ). Only the login command can call the Bourne shell as a login shell. In this case, shell first reads the/etc/profile file and the $ HOME/. profile file. The/etc/profile file defines the environment for all users. The $ HOME/. profile file is the custom environment for this user. Finally, shell will wait to read your input.

2.2 C Shell (csh)
Bill Joy developed C shell at the University of California in Berkeley in the early 1980s S. It is mainly used to make it easier for users to use interactive functions, and converts the ALGOL-style syntax structure into the C language style. It provides functions such as command history, alias, file name replacement, and job control.

2.3 Korn Shell (ksh)
For a long time, there were only two types of shells for people to choose from. The Bourne shell was used for programming and the C shell was used for interaction. To change this situation, AT&T's bell lab David Korn developed the Korn shell. Ksh combines all the interactive features of C shell and incorporates the Bourne shell syntax. Therefore, the Korn shell is widely used by users. It also provides functions such as mathematical computing, coprocess, and inline editing. Korn Shell is an interactive command interpreter and command programming language. it complies with POSIX-an international operating system standard. POSIX is not an operating system, but a standard for application portability-It spans multiple platforms at the source program level.

2.3 Bourne Again Shell (bash)
Bash is part of the GNU program and used to replace the Bourne shell. It is used in GNU-based systems such as Linux. Most Linux (Red Hat, Slackware, Caldera) use bash as the default shell, and bash is actually called when sh is run.

2.4 POSIX Shell (psh)
POSIX shell is a variant of the Korn shell. Currently, the largest seller of POSIX shell is Hewlett-Packard. In HP-UX 11.0, POSIX shell is/bin/sh, while bsh is/usr/old/bin/sh.

The default shell in each major operating system:

Korn Shell in AIX
Solaris. The default is the Bourne shell.
FreeBSD defaults to C shell.
The HP-UX defaults to POSIX shell
Linux is the Bourne Again shell

3. What shell script?
Shell scripts are similar to batch processing in Windows/Dos, and are text files containing command sequences.

4. What is the difference between shell and shell scripts?
Shell: shell is a command parser.

Shell: A shell script is a text file containing a command sequence.

Shell programming

Replace Linux Shell Parameters

Shell for parameters

Pass Linux/Unix Shell parameters to SQL scripts

Introduction to parameter passing methods in Shell scripts

PASS command line parameters through Shell scripts

Linux Shell wildcards, escape characters, metacharacters, and special characters

This article permanently updates the link address:

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.