Ash, bash, Ksh, CSH, zsh

Source: Internet
Author: User
Tags exit in

/bin/bash (the Linux preset shell, the default shell in many Linux distributions today, combines many of the advantages of other shells.) )
/bin/ksh (KornShell by the T-Bell Lab. Developed, in combination with bash)
/BIN/TCSH (Consolidated C Shell, provides more features)
/BIN/CSH (has been replaced by/BIN/TCSH)
/bin/zsh (based on Ksh developed, more powerful shell) now the general shell is used by bash > with Command Auto-complement and other functions, but the basic SH no
SH comes from SystemV Unix, the traditional Unix shell, until now many system administrators still like to use SH.

currently the popular Shell has ash, bash, Ksh, csh, zsh, etc., you can use the following command to view you. Bash (Bourne Again shell) is the most common in Linux. Common: csh (syntax is similar to C language), Pdksh (is the Korn shell extension), tcsh (mini shell), sash (standalone version). Various shell built-in commands are different. There are some bash Ksh, but there are Ksh that bash does not necessarily have. So if you write bash as the environment, then there may be incompatibilities under ksh that cause the script to run or run out of error. Bash and Ksh are written differently. If you have a stopped jobinchThe background, bash doesn't allow you to exit. So after tying exit, your is still in bash shell. by typing exit in Ksh, you actually exits from Ksh and terminate all the processes started in Ksh. Ksh in Solaris Ten doesn't allow you to exit with stopped background process. Enter Ksh in bash, enter Ksh, equivalent to child shell, exit can use CTRL+d, go back to bash, enter bash under Ksh to switch to bash, and of course quit CTRL +d. Of course bash is usually installed, but Ksh is not necessarily installed, if the command is not found, it is not installed. Look at your shell type: # echo $SHELL $SHELL is an environment variable that records the type of shell the user is using. You can use the command: # Shell-name to convert to another shell, where the shell-The name of the shell you want to try to use, such as ash.  This command launches a shell for the user, which, after the shell that was originally logged in, is called a subordinate shell or child shell. Use the command: # Exit to exit the child shell. The reason for using different shells is that they each have their own characteristics, and here's a simple introduction:1.  The ash ash shell, written by Kenneth Almquist, is a small shell that occupies the least system resources in Linux and contains only 24 internal commands, making it inconvenient to use. 2. Bash Bash is the default shell used by Linux systems, which is done by Brian Fox and Chet Ramey, an abbreviation for the Bourne Again Shell, which has a total of 40 internal commands. Linux uses it as the default shell because it has the following features: (1you can use the functions of doskey like DOS to view and quickly enter and modify commands with the UP and DOWN ARROW keys. (2The command that starts with a string is automatically given by finding a match. (3contains its own Help function, you can just type help below the prompt to get assistance. 3. Ksh Ksh is an abbreviation for the Korn shell, written by Eric Gisin, with a total of 42 internal commands.  The biggest advantage of the shell is that it is almost completely compatible with the ksh of the commercial distribution, so you can try out the commercial version of the performance without having to pay for the commercial version. 4. CSH CSH is a Linux-based kernel that consists of 47 authors, represented by William Joy, and has 52 internal commands. The shell is actually pointing/bin/tcsh Such a shell, that is to say, CSH is actually tcsh. 5. Zch Zch is one of the largest shell of Linux, completed by Paul Falstad, with a total of 84 internal commands. It is not necessary to install such a shell if it is a general purpose. Bourne Shell (/usr/old/bin/sh) C Shell (/usr/bin/csh) Korn Shell (/usr/bin/Ksh) POSIX Shell (/usr/bin/sh) How do you know what Shell is currently in use? ① Enter a system that does not recognize commands (such as #fuck_pig) to get system prompts ②#e Cho $0(For: sh/ksh) ③ #ps|grep $$|awk ' {print $4} ' ④#e cho $SHELL (user default shell, but does not reflect the current shell in real time) and in your/etc/you can see more shell:# in shells./etc/Shells:valid Login Shells/bin/Ash/bin/CSH/bin/SH/usr/bin/es/usr/bin/Ksh/bin/Ksh/usr/bin/RC/usr/bin/tcsh/bin/tcsh/usr/bin/zsh/bin/Sash/bin/zsh/usr/bin/Esh/bin/Dash/bin/Bash/bin/Rbash different shells have different functions, and they differ from each other, or say"Datong Small Differences". The common shell is mainly divided into two major mainstream: Sh:burne shell (SH) Burne again shell (bash) csh:c shell (CSH) TC Shell (TCSH) Korn shell (Ksh) reference Old.blog. edu.cn/user1/10137/archives/2005/85452. shtml================If you want to use Ksh as your default shell with the CHSH command format CHSH [-s Shell] [Username] describes the CHSH used to replace the shell that you used to log in. The shell is not specified in the command column. Chsh will prompt one for you. Add your name to the user, so Chsh-S Ksh user can change your default login shell in fact, bash is a lot more powerful than ksh, otherwise, not all Linux distributions use bash as the default shell.

Ash, bash, Ksh, CSH, zsh

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.