The magical use of Git Bash-using linux commands

Source: Internet
Author: User
Tags using git git commands

How do I use Linux commands in Windows?

There are many on the web saying that installing cygwinportable under the CMD window is a Linux command, but there are some flaws.

In fact, there is a very simple and effective way for programmers to use Git Bash.
Git is used in program development and Git Bash is installed. Git Bash is a command-line tool under Windows. Based on the Msys GNU Environment, there is a GIT distributed version Control tool that is used primarily for git. But in addition to using GIT commands, you can also use Linux commands. (There are also some commands that cannot be used, such as apt-get, etc.)

After installing Git bash, simply right-click in the folder blank to eject the console that can enter the Linux command:

Git installs a lot of Baidu experience can be referenced, can also install only git Bash.

Why can I execute a linux command when I install the GIT bash tool under Windows?

The following answers are derived from:

Simply put: Because these tools implement the functionality of Linux in Windows.

Windows and Linux provide applications with a different feature interface, so these apps can't run directly in Windows. There are two ways to get these programs running, one is to modify the program's code so that it uses the Windows interface in Windows. The other is the interface that implements Linux in Windows.
In fact, there are too many programs, one by one to change the code is not convenient, so choose the second method.

Because git for Windows comes with a mingw. It takes this minimal mingw environment for git to run normally.
Other questions look mingw, such as why you can't execute the elf of Linux, because this is MinGW not WSL.

Git for Windows comes with the Windows version of some of the command-line tools under Linux, and note that they are all compiled into WIN32 applications, essentially the WIN32 environment, so you can actually run only Win32 executables.
And WIN10 provides WSL equivalent to a Linux "simulator" (the principle is not exactly the same), you can directly run the Linux binary files

Links: https://www.zhihu.com/question/65055974/answer/227486573
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

The magical use of Git Bash-using linux commands

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.