How to use Linux Command Line through cygwin in Windows

Source: Internet
Author: User
Document directory
  • Add cygwin path to Windows environment variable

The appearance of powershell has greatly improved the Windows command line tool. But for many years, Linux has always had many useful terminals. Here, you can use cygwin to have both of the preceding command line tools. cygwin is a UNIX-like terminal that can run on a Windows PC.

In today's section, we will explain how to run cygwin. The following articles will explain a wide variety of applications on this page, so stay tuned.

Install cygwin

Cygwininstallation in wndowsalso runs setup.exe directly, but pay attention to the following steps. Here we will explain the installation process throughout the process.

To minimize cygwin installation and reduce bandwidth, the default installation method only downloads necessary files from the Internet.

The default installation path is C: cygwin. If you do not want to install it in the C: disk root directory, you can also modify the path or create a C: cygwin link to your own installation directory.

Click Next until you select to download the image. Unfortunately, the installation tool cannot be automatically located, so you need to determine which image will download faster.

After the image is selected, the installation tool will download a valid installation package list. This step will become more complex.

Thousands of installation packages are divided into multiple categories. If you do not know which installation packages to choose, you can use the default options. After installation, run the Installation tool to install additional installation packages.

If you know which installation packages you want, you can search for them and the results will be automatically listed.

Once you click Next, it will take quite some time to download the installation package and complete the installation process.

Add cygwin path to Windows environment variable

After the installation is complete, a cygwin icon will appear on the desktop, through which you can open the cygwin terminal.

Ghost starts with the C: cygwin home directory, but it may be useless because you may not place any files there. You can use all the basic Linux commands, but to return the C: root directory, you must switch the directory to/cygdrive/C.

To use cygwin in a Windows command prompt, you need to add cygwin to the Windows environment variable.

Use the win + pause/Break Key or right-click a property on my computer to open the system property.

Select Advanced System Properties in the left column to open the System Properties window:

Click the environment variable below in the advanced options.

In the system variables, find the PATH variable and click Edit.

Add the bin path under cygwin at the end of the variable value option:

;C:cygwinbin

Note: Make sure that you add a semicolon to distinguish it from other variable values.

Click "OK" to close the dialog, and then open a command prompt to test several Linux commands.

As shown in the following figure, PWD and ls work normally at the windows command prompt. You will also see that/cygdrive/C is automatically added to the current directory display.

After cygwin is installed, you can do more things. In the following articles, we will introduce some useful tools.

 

From: http://article.yeeyan.org/view/200054/171995

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.