From: blog.163.com/magicc_love…

Question 1: What is a Shell?

The operating system can be divided into kernel and Shell. Shell is the main interface between the operating system and the outside, located in the outer layer of the operating system, and provides users with a way to communicate with the core of the operating system. A Shell is a command interpreter (also an application) that sits between the kernel and the user, passing the user’s instructions to the kernel and displaying the results back to the user. At the same time, the shell can be a powerful programming language. Shells are classified into graphical interface shells and command line shells, such as Windows explorer. Exe and CMD command Windows. Different systems have different shells, such as bash, C shell, Windows Power shell, etc. On Linux systems, this is usually the Bourne Again shell (bash).

Problem two: DOS and Windows CMD difference

Exe (resource manager) is graphical shell, and CMD is the command line shell, and DOS itself is a system, this is the biggest difference between CMD and DOS: one is only interface, one is an operating system. However, some commands in CMD are similar to commands in DOS, so many people confuse the two. CMD belongs to a part of Windows system, DOS itself is a system, in the DOS system can be deleted, repair Windows system, and in the CMD is not.

Q 3: What is the difference between Linux shell (bash) and Windows CMD?

On Linux/Unix platforms, there are multiple implementations of the Shell, and most current Linux distributions default to bash, the Bourne Again Shell. On Windows, CMD, short for Command shell, is an independent application program. It provides users with the function of direct communication with the operating system. It provides a non-graphical running environment for character-based applications and tools. Thus, it can be approximatively considered that Linux shell=bash and Windows shell= CMD are both command line interpreters and interfaces between the user and the operating system. But bash is much more powerful than CMD, and Windows also has a powerful shell called Windows Power Shell. PsWindows system accept shell command program is CMD command line window; The corresponding program in the Linux distribution ubuntu is the Terminal.

Q4: Are scripting languages different from programming languages?

Programming languages are “write – compile – link – run” (compiled) and scripting languages are “explain – execute” (interpreted). Script language program code even the final executable file, through the corresponding interpreter to explain execution, so more convenient and fast. Each scripting language needs its own interpreter. For example, Perl, Python, Ruby, JavaScript and so on are all scripting languages. Shell also belongs to a special scripting language.

Can bash shell be used on Windows?

Bash is a shell for Linux and Unix. If you really want to try it out, you can install the Cygwin environment on MS Windows and then use it under it. Note that the Cygwin environment is different from the real Linux or Unix environment, and some commands will not run properly. The most direct experience, or use Linux to intimate, almost can do anything. If you want to use Shell in MS Windows, it is recommended to use Microsoft PowerShell, which gives you full functionality in MS Windows.