gpt4 book ai didi

bash - PowerShell grep 等效项

转载 作者:行者123 更新时间:2023-12-03 03:14:09 27 4
gpt4 key购买 nike

我正在尝试将此命令行从 bash 移植到 PowerShell:

git verify-pack -v .git/objects/pack/pack-*.idx | grep -v chain | sort -k3nr | head

到目前为止我有这个:

git verify-pack -v (Get-ChildItem ".git/objects/pack/pack-*.idx") | select-string -pattern "chain"

但是如何在 PowerShell 中进行反向匹配(选项 -vgrep )?

最佳答案

你的意思是-NotMatch

Select-String -NotMatch -Pattern "chain"

Select-String @ Technet

关于bash - PowerShell grep 等效项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37616403/

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