Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用此命令在存档中搜索字符串.. zgrep 'order-number' *fastbg* > /tmp/order-number.fastbg.txt
zgrep 'order-number' *fastbg* > /tmp/order-number.fastbg.txt
如何使用脚本或查找命令搜索多个日期目录(20210302、20210303、20210304..)。我仍然想在 /tmp 上输出结果。任何人都可以帮忙吗?
这应该可以解决问题:
find /path/to/numbered/dirs -type f -name \*fastbg\* -print0|xargs -0 zgrep 'order-number' > /tmp/order-number.fastbg.txt
如果您不需要zgrep -h上面输出中的文件名。
zgrep -h