find wwwwwwroota -name txt -exec sh -c grep -qE 圣龙香港澳门预言 $1 && sed -e 圣d -e 龙d -e 香港d -e 澳门d -e 预言d $1 wwwwwwrootafiletxt sh ;将上面代码改为在 wwwwwwroota 目录下查找所有后缀为 txt 的文件并将包含关键字的行复制到 wwwwwwrootafiletxt 中
find /www/wwwroot/a -name "*.txt" -exec sh -c 'grep -qE "圣|龙|香港|澳门|预言" "$1" && grep -E "圣|龙|香港|澳门|预言" "$1" >> /www/wwwroot/a/file.txt' sh {} ;
原文地址: https://www.cveoy.top/t/topic/gPtd 著作权归作者所有。请勿转载和采集!