cygwin 在windows下使用linux命令的方法

來源:互聯網
上載者:User

但是cygwin過於複雜龐大,下載比較費勁,本人最終沒有下載,也沒有用過。個人感覺GunWin32是一個不錯的選擇,GnuWin32使windows使用者可以在命令列視窗中使用各種各樣的linux命令,就跟使用普通的windows命令一樣簡單。

1.下載GnuWin32,GnuWin32的安裝檔案(GetGnuWin32-0.6.3.exe):http://sourceforge.net/projects/getgnuwin32/,官網地址:http://gnuwin32.sourceforge.net/
2.運行GetGnuWin32-0.6.3.exe,並指定安裝目錄。
3.進入安裝目錄的GetGnuWin32子目錄,GetGnuWin32子目錄是GetGnuWin32-0.6.3.exe自動建立的
4.運行download.bat,這個過程會從網路上下載所有linux命令程式,所以需要等待很長時間,大家可以出去打打醬油什麼的
5.運行install.bat,到此安裝結束,大家可以開始使用各種linux命令了。

命令使用方法:
1. find + grep 尋找指定檔案: find D:\* | grep .xml

2. type/cat + grep 過濾檔案內容:cat test.txt | grep KEY2 或 type test.txt | grep KEY2

3. sed刪除檔案內容:cat test.txt | sed "s/\[KEY2\] //"

4. iconv轉換檔編碼:iconv -f gbk -t utf-8 史上第一掌門.txt > 史上第一掌門_utf-8.txt

5. 圖片格式轉換格式jpeg到pnm: jpegtopnm cat_type_grep.jpg > cat_type_grep.jpg.pnm

6. 圖片格式轉換格式pnm到png: pnmtopng cat_type_grep.jpg.pnm > cat_type_grep.png

7. 圖片格式轉換格式jpeg到png: jpegtopnm cat_type_grep.jpg | pnmtopng > cat_type_grep.png

8. 批量轉化圖片:for /r .\ %i in (*.jpg) do jpegtopnm %i | pnmtopng > %~ni.png

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.