You can install this software using Linux commands in Windows (Cygwin)

Because I often use Linux commands, I often make mistakes when entering commands in Windows cmd, and the prompt is not an internal or external command, nor is it a runnable program.

insert image description here
So is there a way to complete the cmd command so that the commands in Linux can also be used in Windows?

Let me explain how to use Linux commands in the Windows CMD command line.

Introduction to Cygwin

Cygwin is a UNIX-like simulation environment running on the Windows platform. It is useful for learning the UNIX/Linux operating environment, or porting applications from UNIX to Windows, or doing some special development work, especially using the GNU tool set on Windows. It is very useful for embedded system development.

Download Cygwin

We visit Github and search for CygwinPortable to enter the project page

https://github.com/MachinaCore/CygwinPortable/

insert image description here

Click on Release the link , we downloadCygwinPortable_1.4.0.0.7z

insert image description here

Install Cygwin

Unzip the downloaded 7z compressed package, rename it and Cygwinput it the root directory of the C drive

insert image description here
Enter the Cygwin directory and start CygwinPortable.exethe program
insert image description here
. After starting the installer, we chooseDownload Cygwin X64
insert image description here

The Cygwin installer will download and install all related programs online, and the program will automatically close after the installation is complete.

insert image description here
At this point, you can see the Cygwin program icon in the lower right corner of the taskbar.

insert image description here

Search Cygwincan find the Cygwin terminal program, we startCygwin64 Terminal

insert image description here

Now we can enter common Linux commands in this terminal. The default path after the terminal is started is

C:\Cygwin\App\Runtime\Cygwin\home\用户目录

insert image description here

Configure environment variables

After installation, it still cannot be used in the cmd command line. If we want to make it available in the cmd command, we must configure the system environment variables.

Win+ RWe enter in the run window sysdm.cplto start the system properties panel.

insert image description here

Click on 高级the tab , we find the function of opening environment variables

insert image description here

Find this column 系统变量in the bottom , select it and click the button.Path编辑

insert image description here
Click 新建the button to add the Cygwin bin directory. If you have configured it step by step according to my steps before, just fill in the following path, and confirm to exit after adding.

C:\Cygwin\App\Runtime\Cygwin\bin

insert image description here

  • Add environment variables with the command

Open CMD with administrator privileges and enter the following command to add a system environment variable

setx path "%PATH%;C:\Cygwin\App\Runtime\Cygwin\bin" /M

use linux commands

We start the CMD terminal, and then use lsthe command to use it normally. Cygwin integrates more than 270 Linux commands.

insert image description here

Try using grepthe search function

insert image description here

Guess you like

Origin blog.csdn.net/no1xium/article/details/130077295