PowerShell 类grep工具

版权声明:博客地址:blog.csdn.net/x356982611,未经允许不得转载,不得转载,不得转载 https://blog.csdn.net/x356982611/article/details/84306657

简介

grep 在Linux中过滤查询实在是太方便了,windows中没有grep,但是有替代的方案.下面介绍下简单的用法,复杂的使用自己查找相关的文档

命令

findstr

这个命令在cmd中就可以使用

cat .\create.tf  |findstr alicloud_slb

where

cat .\create.tf  |where {$_ -match "alicloud_slb"}

Select-String

Select-String "alicloud_slb" .\create.tf

引用

https://mcpmag.com/articles/2015/12/02/where-method-in-powershell.aspx

猜你喜欢

转载自blog.csdn.net/x356982611/article/details/84306657