Differences and connections between shell, cmd, dos and script statements

Question 1: The difference between cmd in DOS and windows

 

In windows system, "start-run-cmd" can open "cmd.exe" for command line operation.

The operating system can be divided into two parts: the kernel and the shell. Among them, the 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. The desktop explorer.exe (Explorer) seen in the windows system is a graphical shell, and cmd is a command-line shell. This can be regarded as the biggest difference between cmd and dos, one is only the interface, the other is the operating system. It's just that some commands in cmd are similar to those in dos, so many people confuse the two. CMD is a part of the windows system. DOS itself is a system. You can delete and repair the windows system under the DOS system, but not under cmd.

 

Question 2: What is the shell under Linux?

 

Shell is commonly known as shell (used to distinguish it from nuclear kernel) and is a "command parser". According to the definition of ABS, the shell is The shell is a command interpreter. More than just the insulating layer between the operating system kernel and the user, it's also a fairly powerful programming language. Divided into two categories: graphical interface shell and command line shell.

Shell manages the interaction between you and the operating system: waiting for your input, interpreting your input to the operating system, and processing the output of various operating systems. Different systems have different shells, such as bash, C shell, windows power shell, etc.; in linux systems, it is usually Bourne Again shell (ie bash).

 

Question 3: Can bash shell be used under windows?

 

Bash is a shell under Linux and Unix. If you really want to try it out, you can install the Cygwin environment under MS windows, and then use it under it. At this time, it should be noted that there is a difference between the Cygwin environment and the real Linux or Unix, and some commands will run abnormally. The most direct experience is to use Linux to be intimate, and you can do almost anything. If you want to use Shell under MS Windows, it is recommended to use Microsoft PowerShell, which can provide you with the full functionality of operating MS windows.

 

Question 4: What is the difference between a scripting language and an ordinary programming language?

 

The programming language "write-compile-link-run", the script language is "interpret-execute" rather than compile, even the final executable file of the script language program code can be interpreted and executed by the corresponding interpreter, so it is more convenient and faster . Each scripting language needs its corresponding interpreter. For example, Perl, Python, Ruby, JavaScript, etc. are all scripting languages, and shell is also a special scripting language.

 

Question 5: What is the difference between linux shell, bash and windows cmd?

 

The shell is a command interpreter (also a kind of application), between the kernel and the user, responsible for passing the user's instructions to the kernel and echoing the execution results to the user. At the same time, the shell can also be used as a powerful programming language . On the linux/unix platform, the shell is mostly the Bash shell by default.

cmd is short for Command shell, Microsoft's definition is: The command shell is a separate software program that provides direct communication between the user and the operating system. The non-graphical command shell user interface provides the environment in which you run character-based applications and utilities. The command shell executes programs and displays their output on the screen by using individual characters similar to the MS-DOS command interpreter Command.com. (CommandShell is an independent application that provides users with direct communication to the operating system It provides a non-graphical interface operating environment for character-based applications and tools. It executes commands and echoes MS-DOS-style characters on the screen.) Therefore, it can be roughly considered that linux shell=bash and windows =cmd, both are command line interpreters, which are the interactive interface 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.

Guess you like

Origin blog.csdn.net/VABTC/article/details/109072035