The relationship between the shell, bash, terminal and kernel

The relationship between the shell, bash, terminal and kernel

This article is the "Bird Brother Linux private kitchens," the study notes

What is the kernel

kernel of Chinese is "operating system kernel", mainly used to manage the hardware and the associated ability to provide implementation, such as hard disk access, network functions, CPU resource acquisition and so on. Knernel and on the relationship between the various linux distributions, the article says it well:

Source: https://www.fdzh.org/slides/2015/06/20/linux-distr/

What Linux distribution is that it have anything to do with the Linux kernel?

The Linux kernel is the core of a computer operating system. A complete Linux distribution includes a core and a number of other file-related operations, user management system, and the package manager and a series of software. Each tool is a small part of the whole system. These tools are usually a separate project, there is a corresponding developer to develop and maintain.

The aforementioned Linux kernel, including the current version, and a version of history (that is, the version published earlier) can be found in www.kernel.org. Many Linux distributions may be based on different kernel versions. For example: the popular RHEL6 release is based on very old but very stable 2.6.32 version of the Linux kernel. Some other distributions may be quickly updated to accommodate the latest version of the kernel. Of particular note is that the kernel is not an either-or proposition, for example RHEL6 on the introduction of many new and improved version of the kernel in 2.6.32 kernel.

Other basic tools provided by each release and components as well as including the following contents: C / C ++ compiler, gdbdebugger debugging tools, core system library applications, low-level interface for drawing on the screen and advanced desktop environment, and for installation and updates, including the kernel, including many established systems

Many different Linux distributions to meet the different needs of different users and organizations. Large businesses usually prefer to use reason Red release provides the Hat, SUSE, and Canonical (Ubuntu).

Fedora is a community-based version of RHEL, CentOS, Scientific Linux, and Oracle Linux is. Compared to RHEL, Fedora package significantly more packages. One reason is that the diversification of community involvement in Fedora-building; it's not just a company. In this process, CentOS for activities, demonstrations and experiments, because it is the end user's free, and have a Fedora release cycle than the longer (usually release a new version every six months or so).

SUSE, the relationship between the SUSE Linux Enterprise Server (SLES), and openSUSE is similar to the relationship between Fedora, Red Hat Enterprise Linux, and CentOS's.

Debian is the release of many, including upstream, including Ubuntu, and Ubuntu is Linux Mint and other upstream releases. Debian server and desktop fields have a wide range of applications. Debian is a pure open source project and focus on a key point, stability. It also provides the most complete and depots to the user.

Note: Debian, Cent OS and Ubuntu, etc., are release, refers to the maintenance of linux kernel-based linus, by some vendors offer beautiful and easy to use desktop publishing software commonly used goods. But part of the distribution inherited another part of the release function, such as Ubuntu and Debian. Only linux kernel version developed by the development team

About the comparison between the various releases, see this article: https://www.zhihu.com/question/29406367

You can use kernel version uname -a view the release used: for example, the results of my ubuntu 18.04 query is 5.0.0-32-genericquery the network shows that this package is included in "the unsigned Linux kernel image for version 5.0.0 on ARMv8 SMP."

What is a shell and bash

shell means "Shell Program", refers to the interface program can operate on the operating system and applications , narrow shell program refers to the command line aspects of software, for example the bash; generalized to include a program in a graphical interface .

There is a shell more than . In the computer the course of history, there are many kinds of shell, such as:

  • Bourne shell (referred to simply as sh): The first shell
  • C shell (referred to as csh): As the C language syntax is similar to named
  • Bourne Again Shell (referred to as bash): This is an enhanced version of the Bourne shell
  • Tenex C shell (referred to as tcsh): is an enhanced version of the C shell

We are using the default Linux bash, but in fact, many types of support. You can view linux shell supported by this command: vim /etc/shells.

There are different shell syntax differences. Linux is used by default shell is bash, so we just need to learn bash, you can be happy with any of a linux distro!

We have just mentioned / etc / shells, in fact, is a file in the / etc directory, you can see after opening:

  1 # /etc/shells: valid login shells
  2 /bin/sh
  3 /bin/bash
  4 /bin/rbash
  5 /bin/dash

This file is used to position the system shell that can be used records, but only a part, not all . When the system to perform certain services can be operated according to records of the file.

/ Etc directory there is a file called passwd, we use vim open look:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin

When different users log in, the system will give us a default shell to work, and that the different users default shell What are what? These records were all in the / etc / passwd file. It can help the system control user privileges, such as the root user here can use bash, but like some of the less privileged users, for example, where the bin and daemon users (both of which are the system account), use one called nologin the shell, which limits the function, thus limiting them to modify the system and use of system functions. Similarly, we can use the chsh command to replace the shell, but the replacement of results need to restart the shell can be reflected.

In addition, some programs will be judged according to / etc / shells This file whether a user is a valid user, for example, some FTP service will not stop those shell / etc / shells landed inside the users. In this way, we set up a login shell that is not in the user list will not be able to use ftp service on this host in / etc / passwd in the

In this way, we know what is right and bash shell

What is terminal

We use the terminal in Linux, it is actually a "terminal emulation software," which simulates a real terminal, which is a few decades ago, when the terminal: includes only keyboard + monitor, even when the electricity before then Biography typewriter. Now, we use the terminal software refers to software that can run shell commands. It is generally tied to the desktop environment, such as gnome terminal etc., we ourselves can also install additional terminal. It is similar to an application input method.

What is .bashrc

.bashrc located / home / <user name> directory

Source: https://linux.cn/article-9298-1.html

bash is able to explain a terminal program you enter into something, and based on your input to run the command. It supports the use of scripts to customize functions to some degree, this time we should use .bashrcthe.

In order to load your configuration, bash will be loaded every time you start .bashrcthe contents of the file. Each user's home directory have this shell script. It is used to store and load your terminal configuration and environment variables.

Enter .bashrc

vim ~/.bashrc

After opening you can see there are a lot of items.

Here we can alias is added to the alias command, thereby simplifying the input terminal. For example, we can take common command alias ssh connection, so you do not need a long list of every input.

Guess you like

Origin www.cnblogs.com/jiading/p/11826773.html