Know bash, the shell.

Source: Internet
Author: User

We communicate the commands we enter with the kernel through the shell so that the kernel can control the hardware to work correctly
Bash is our default shell for Linux

User interface (Shell,application)--------core (Kernel)-------hardware (Hardware)
?
The operating system is actually a group of software, because this group of software in the control of the entire hardware and management system activity monitoring, if this group of software is operated by the user casually, if the user improper application, will make the whole system crash.

Because the operating system manages the entire hardware function, it is of course not able to be arbitrarily used by some end users who are not able to manage.
But we always need to let the user operating system, so there are applications developed on the operating system.

Software = program + documentation = Data structure + algorithm + documentation

The shell's functionality simply provides an interface to the user's operating system.
Like Cmake,man,chown These commands are installed independently of the application, butWe can manipulate these applications through the shell (that is, command-line mode), and let these applications invoke the kernel to run the required work。

As long as the interface that can manipulate the application can be called the shell
Narrow shell-time command-side software such as bash, a generalized shell that includes graphical interface software

Why study the shell?
1.X window like web interface tools, although the interface is friendly, powerful, but after all, it is the use of all the software to integrate together a group of applications, not a complete suite, so sometimes when you upgrade or use other suite management module, it will cause the setup problem. and different distribution design of the X Window interface is different, resulting in learning problems. andalmost all distributions use the same bash.。
2. Remote management, command line interface faster: Linux management often requires remote online,command line transfer speed must be faster when online。 AndLess prone to wire breaks or information outflowsThe problem.
3. Is the two-channel Linux, the book to Time to hate less: if you really want to manage your host, then good shell program must be written.

There are many kinds of shells, such as bournce shell (SH), sun default C shell, commercially used k shell, and tcsh, etc.
Usually "Bournce Again Shell" (bash), when SH's enhancement class, is also based on the gun architecture developed

To see how many shells are on a Linux host, you can view the/etc/shells file

/bin/sh has been replaced by/bin/bash.

Why is the legal shell on our system going to write/etc/shells this file?
Because some of the system's services are running, check the shells that the user is able to use, and these shell queries are based on the/etc/shells file

When can a user get a shell to work? What kind of shell does the user use by default?
See/ETC/PASSWD and get the default shell when a user logs in
Some weird shell, look at it later.


One of the most important tool software in the gun program at bash
Key benefits of Bash:
1. Command memory capability (history)
Default memory function is generally 1000, recorded in the/home/user name/.bash_history (no home directory Users what to do)
The. Bash_history records the command that was executed before the previous login, the command that was executed by the login is temporarily in temporary memory, and the command memory will be recorded again when the system is successfully unregistered. bash_history
2. Command and file Completion function: Tab function
3. Command alias setting function (alias)
4. Operation control, front office control (job Control,foreground,background)
Can be at any time to throw work into the background execution, not afraid of accidentally CTRL + C terminal process. CTRL + Z
It also makes it possible to multitask in a single sign-on environment
5. Program script (shell script)
The shell scripts can write a sequential command that the management system often needs to execute, which can be used to carry out the inspection of the host by interactive means.
6. Wildcard characters
Help users query and command execution, speed up user operations such as Ls-l/usr/bin/x*

If the shell command is longer, you can "\[enter" the line break execution



Know bash, the shell.

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.