Home > Operation and Maintenance > Linux Operation and Maintenance > What are the three commonly used shells in Linux?

What are the three commonly used shells in Linux?

青灯夜游
Release: 2022-05-09 15:52:27
Original
7496 people have browsed it

Three shells: 1. bourne shel, referred to as sh, is an interchangeable command interpreter and command programming language; 2. c shell, referred to as csh, uses "C-like" syntax and is C-style A kind of shell; 3. korn shell, upwardly compatible with sh, and contains many features of csh.

What are the three commonly used shells in Linux?

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

What is shell?

The shell of the Linux system serves as the shell of the operating system and provides users with an interface for using the operating system. It is a command language, command interpreter and programming language.

The shell is the interface program between the user and the Linux kernel. If you imagine the Linux kernel as the center of a sphere, the shell is the outer layer surrounding the kernel. When commands are passed to Linux from a shell or other program, the kernel reacts accordingly.

Shell is a command language interpreter. It has its own built-in shell command set. The shell can also be called by other applications in the system. The commands entered by the user at the prompt are first interpreted by the shell and then passed to the Linux kernel.

Three commonly used shells in Linux

There are many types of shells in Linux, the three most commonly used are bourne shell(sh ), c shell (csh), korn shell (ksh).

1. Bourne shell

Bourne shell is an interactive command interpreter and command programming language.

Bourne shell is a standard UNIX shell, which was often used to manage systems. Most of the system management command files, such as rc start, stop and shutdown, are Bourne shell command files, and are often used by system administrators when logged in as root in single user mode. Bourne shell was developed by AT&T and is famous for its simplicity and speed. The default value for the Bourne shell prompt symbol is $.

2. c shell

c shell is a variant Shell that is more suitable than Bourne Shell. It uses "C-like" syntax, and csh is A shell with C language style, it has 52 internal commands, which is relatively large.

C shell was developed at Berkeley and has added some new features, such as command line history, aliases, built-in arithmetic, filename completion ), and job control. For users who often execute shells in conversation mode, they prefer to use the C shell; but for system administrators, they prefer to use the Bourne shell as the command file because the Bourne shell command file is better than the C shell command file. It comes easy and fast. The default value for the C shell prompt symbol is %.

3. korn shell

korn shell is a Unix shell. It was written by David Korn at Bell Labs in the early 1980s. It is fully upwardly compatible with the Bourne shell and includes many features of the C shell, such as command editing required by Bell Labs users.

Korn shell is a superset of Bourne shell, developed by David Korn of AT&T. It adds some features and is more advanced than the C shell. Features of the Korn shell include editable procedures, aliases, functions, regular expression wildcards, built-in arithmetic, job control, coprocessing, and special exceptions. Wrong function. The Bourne shell is almost completely upward compatible with the Korn shell, so programs developed under the Bourne shell can still be executed on the Korn shell. The default value for the Korn shell prompt symbol is also $. The Korn shell used on Linux systems is called pdksh, which refers to Public Domain Korn Shell.

The three shells have their own advantages and disadvantages:

sh is the original shell used by Unix and can be used on every Unix. sh is quite good at shell programming, but it is not as good as csh and ksh in handling interaction with the user.

The default shell of Linux is bourne again shell (bash), which is fully backward compatible with sh. bash is placed in bin/bash. It has many features and can provide functions such as command completion, command editing and command history table. It also contains many advantages of csh and ksh, has a flexible and powerful programming interface, and at the same time Has a friendly user interface.

Therefore, we must at least know that both sh and bash are the default shells on Linux, and bash is an upgraded version of sh.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What are the three commonly used shells in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template