<转:http://www.cnblogs.com/adgnat/archive/2011/07/16/2108098.html>

使用过linxu的伙计估计都会喜欢上linux各种各样强大的命令如:grep, sed,awk,diff和patch。cygwin是一个windows下的linux模拟器,对于想在windows下使用linux命令的人来说是一个选择。但是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

在windows下使用linux命令的更多相关文章

  1. 在windows下使用linux命令,GnuWin32的使用.

    http://sourceforge.net/projects/getgnuwin32 使用过linxu的伙计估计都会喜欢上linux各种各样强大的命令如:grep, sed,awk,diff和pat ...

  2. 如何在windows下运行Linux命令?(转载)

    在windows上可以运行或使用linux下面的命令吗?可以,小编今天就来分享怎么样让Windows支持Linux命令,做这些安装和设置后,就可以非常方便的在windows系统中使用linux下面的命 ...

  3. windows下模拟linux命令的工具 xshell

    windows下模拟linux命令的工具 xshell

  4. 惊艳的cygwin——Windows下的Linux命令行环境的配置和使用

    http://www.tuicool.com/articles/2MramqI 时间 2014-07-29 09:28:36  点滴之间 聚沙成金 原文  http://www.path8.net/t ...

  5. 干掉cmd:windows下使用linux命令行

    对于喜欢用命令行的朋友们,在windows下面使用cmd窗口是不是很不爽?复制不方便?不能随意放大缩小?如果需要多个控制台要多个窗口?....各种不爽 一.基础工具 如果你也不爽,那就对了,所以给大家 ...

  6. Windows下运行Linux命令

    安装Gow软件,Gow-0.7.0.exe,这样就可以在Windows命令行运行Linux命令,比如通过scp把Windows下的文件拷贝到Linux下. 直接运行安装,不会生成任何客户端,直接使用W ...

  7. 【Cygwin】Windows下使用linux命令

    我参阅了这份文章: 让windows cmd也用上linux命令 原文时间有点久了,Cygwin也更新了... 所以我的做法简单了很多... 到Cygwin官网下载安装包:https://cygwin ...

  8. windows下使用linux命令搜文件

    在linux系统的黑幕下,我们只能通过find命令来搜文件,而在windows的界面里,我们只能通过搜索框来搜.两者各有利弊,前者单调但高效,后者用户体验好却比较慢.能不能在windows使用linu ...

  9. windows下使用 linux命令好办法

    1. 安装下载 CygwinPortable一键安装包.7z 2. 把安装路径下/  [D:\cygwinportable\CygwinPortable\App\Cygwin\bin] 加到 Path ...

随机推荐

  1. windows7旗舰版激活密钥永久版免费分享

    windows7之家不仅提供精品Win7教程 给大家,加上这个windows7激活密匙还帮大家解决windows7系统激活问题,包括win7旗舰版 windows7安装版这些. 用的是Windows7 ...

  2. Avoiding PostgreSQL database corruption

    TL;DR: Don't ever set fsync=off, don't kill -9 the postmaster then deletepostmaster.pid, don't run P ...

  3. Measuring the amount of writes in InnoDB redo logs

    Choosing a good InnoDB log file size is key to InnoDB write performance. This can be done by measuri ...

  4. nginx和apache配置目录浏览功能

    今天工作需要,要给客户提供一个patch的下载地址,于是想用nginx的目录浏览功能来做,需要让客户看到指定一个目录下的文件列表,然后让他自己来选择该下载那个文件: 我们都知道在apache下可以配置 ...

  5. SharePoint入门识记

    SharePoint站点层次结构: 1.Web Application: 一般创建后对应一个IIS Web Site, 默认创建后是打不开的,因为网站没有任何内容. 2.Site Collection ...

  6. python中文输出和写入文本

    中文输出 #-*-coding:utf8-*- import requests import re timeout = 8 headers = {'User-Agent':'Mozilla/5.0 ( ...

  7. 解决Oracle 11g在用EXP导出时,空表不能导出

    实践结论可行,看"2.解决办法" 一.问题原因:     11G中有个新特性,当表无数据时,不分配segment,以节省空间     1.insert一行,再rollback就产生 ...

  8. net cookie操作

    写入方法: HttpCookie cookie = new HttpCookie("id"); cookie.Value=cookieValue; cookie.Expires = ...

  9. ASP.NET MVC 出现错误 “The view 'XXX' or its master was not found or no view engine support”

    来自:http://www.dengyukeji.com/archiver/tid-151.html 错误如下:The view 'XXX' or its master was not found o ...

  10. 动态代理到基于动态代理的AOP

    动态代理,是java支持的一种程序设计方法. 动态代理实现中有两个重要的接口和类,分别是InvocationHandler(interface),Proxy(class). 要实现动态代理,必须要定义 ...