Understanding and learning BASH and shell

Source: Internet
Author: User
BASH includes: setting variables and using the bash operating environment to build a data stream redirection function pipeline command bash command line is indispensable for host maintenance and management help 1.1 understand bash, shell, which manages computer hardware is actually operation system... BASH includes: setting variables and using the bash operating environment to build a data stream redirection function pipeline command bash command line is indispensable for host maintenance and management help 1.1 understand bash, shell, which manages computer hardware is actually the kernel of the operating system, the kernel is protected, so generally users can only communicate with the kernel through shell. To let the computer do one thing, we must use Shell to communicate the commands we input with the kernel so that the kernel can control the hardware to do the correct work. What really controls the hardware is the CPU process, memory management, disk output input, and so on. Hardware is a physical worker, including hard disks: Display Card network card CPU and so on. The essence of an operating system is: a set of software shell functions: provides an interface for a user's operating system. to use a shell, you need to use other software to call it, in fact, every command line we use is an independent application. That is to say, any interface that can operate an application can be called a shell. Shell in the narrow sense refers to the command line software. A shell in the broad sense includes graphical interface software. In Unix: Shell classification: K SHell TCSH is often used in the default C Shell business in Bourne Shell (sh) Sun. Which of the following statements is used by du Niang or Gu Ge RHEL and CentOS? Linux: his shell is the Bourne Again SHell called bash. This Shell is an enhanced version of the Bourne Shell. Shell:/etc/sehlls that can be used in CentOS (I have found) /bin/sh is replaced by/bin/bash./bin/bash Linux default shell/bin/ksh Kornshell by AT&T Bell lab. developed and compatible with bash/bin/tcsh (integrating C Shell and providing more functions)/bin/csh (already replaced by/bin/tcsh) /bin/zsh (a powerful shell developed based on ksh) does not use the/etc/shell file because the system server is running, go back and check the shells that can be used by users. The shell query uses the/etc/shells file. When will shell start to work? For example, when logging on, the shell is recorded in/etc/password, and the last data in each line is the default shell Linux uses the/bin/bash shell by default. Shell functions: the command memory function (history) command and the setting function of the file population full-featured command alias (alias) are very useful! For example, to set lm to ls-al alias lm = 'ls-AL', open a path directly: alias cdd = 'CD/home/angle/real' remember that some non-bash command line inputs are set in this way, in addition, each user must set the following command if you want to use this command. The reason is simple, because each user has its own bash. Job control, foreground, and background control. foreground, background (Chapter 17) shell script (Chapter 13) Wildcard (Wildcard) eg: to know how many files starting with X under/usr/bin are used: built-in commands of ls-l/usr/bin/X * bash shell: use the type command to determine whether each command is executed by the bash built-in command eg: type-a ls type cd: for example, the command cp/var/spool/mail/root/etc/crontab \>/etc/fstab/root is used to copy three files to the/root directory, because it is too long to use \ ENTER to "escape" the [ENTER] key, so that ENTER does not have the "start function", so that the command can continue to input in the next line. Note: the [ENTER] Button must follow the backslash \. if the escape is successful, the> symbol will appear. it means you can continue to ENTER the command.> it is automatically displayed by the system, manual input is not required. Summary: When we successfully log on to the terminal (tty), Linux will give us a shell (bash by default) based on the setting of the/etc/password file ), then we can operate the shell according to the command execution method above, and then we can use the man online query command usage and parameter description.
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.