windows下grep的安装与使用

 

1、官网下载安装包:

地址:http://gnuwin32.sourceforge.net/packages/grep.htm

也可以Google 搜“ Grep for Windows ” 。

 

下载下来是一个exe:

grep-2.5.4-setup.exe

 

2、安装

安装到默认目录就可以了,要记住你要安装的目录。(比如我是:C:\Program Files (x86)\GnuWin32\bin  )

 

 

3、添加grep到环境变量

这一步很重要,若没有添加grep到环境变量,这个时候使用windows的powershell是不能使用grep的,

会报错:grep : 无法将“grep”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。

 

 

4、验证下:

【before】

 【after】

 

 

ok ,成功!

posted on 2022-09-06 17:58  CuriousZero  阅读(10445)  评论(0编辑  收藏  举报

导航