gpt4 book ai didi

powershell - 如何在PowerShell中使用Get-Content和Select-String输出与 'this_string'不匹配的行?

转载 作者:行者123 更新时间:2023-12-03 13:05:03 28 4
gpt4 key购买 nike

我找到了一篇有关希望在PowerShell中使用grep的用户的帖子。例如,

PS> Get-Content file_to_grep | Select-String "the_thing_to_grep_for"

如何输出不是this_string的行?

最佳答案

Select-String具有NotMatch参数。

get-content file_to_grep | select-string -notmatch "the_thing_to_grep_for"

关于powershell - 如何在PowerShell中使用Get-Content和Select-String输出与 'this_string'不匹配的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8214937/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com