Cygwin how to use Linux commands under Windows _dos/bat

Source: Internet
Author: User
But Cygwin too complex and huge, download more laborious, I finally did not download, also did not use. Personal feeling GunWin32 is a good choice, GnuWin32 allows Windows users to use a variety of Linux commands in a command-line window, just as simple as using normal Windows commands.

1. Download Gnuwin32,gnuwin32 installation file (getgnuwin32-0.6.3.exe) Download address: http://sourceforge.net/projects/getgnuwin32/, official website address: http:/ /gnuwin32.sourceforge.net/
2. Run Getgnuwin32-0.6.3.exe and specify the installation directory.
3. Enter the GETGNUWIN32 subdirectory of the installation directory, the GETGNUWIN32 subdirectory is getgnuwin32-0.6.3.exe automatically established
4. Run Download.bat, this process will download all Linux command program from the network, so need to wait for a long time, we can go out to play soy sauce or something
5. Run Install.bat, the end of this installation, you can start to use a variety of Linux commands.

How to use the command:
1. Find + grep lookup specified file: found d:\* | grep. xml



2. Type/cat + grep filter file content: Cat Test.txt | grep KEY2 or Type Test.txt | grep KEY2



3. sed Delete file content: Cat Test.txt | Sed "s/\[key2\]//"



4. Iconv Conversion file Encoding: Iconv-f gbk-t utf-8 first Masters. txt > The first Masters in history _utf-8.txt

5. Picture format conversion format jpeg to PNM:JPEGTOPNM cat_type_grep.jpg > CAT_TYPE_GREP.JPG.PNM

6. Picture format conversion format PNM to png:pnmtopng CAT_TYPE_GREP.JPG.PNM > Cat_type_grep.png

7. Picture format conversion format jpeg to PNG:JPEGTOPNM cat_type_grep.jpg | Pnmtopng > Cat_type_grep.png

8. Batch Conversion Picture: FOR/R. \%i in (*.jpg) do JPEGTOPNM%i | Pnmtopng >%~ni.png

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.