gpt4 book ai didi

linux - 如何在 linux 中找到一个字符串匹配和一个字符串不匹配的 jar

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:24:04 25 4
gpt4 key购买 nike

我想找到具有字符串“hello”但不应包含字符串“helloworld”的 jar 。我尝试了如下命令,

find . -iname '*.jar' -printf "unzip -c %p | grep -q 'hello' && grep -qL 'helloworld' && echo %p\n" | sh

没有提供正确的 jars。想知道在 grep 中传递两个条件的命令吗?

最佳答案

find . -name "*.jar" -exec bash -c 'f={};jar tf $f| grep "hello" | grep -q -v "helloworld" && echo $f' \;

关于linux - 如何在 linux 中找到一个字符串匹配和一个字符串不匹配的 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38246227/

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