Answers:
您要做的是使用pipe和 greps -Z选项:
使用GNU grep和mv
grep -LZ -- Attachments * | xargs -0 mv -t target_directory
该-Z联合xargs -0柄任何文件名有特殊字符。
使用BSD grep和mv(例如在MacOS X上)
grep -L --null -- Attachments * |
while IFS= read -r -d "" file; do
mv "./$file" target_directory
done
在BSD,grep -Z手段解压缩,grep --null适用于BSD都和GNU。BSD mv缺乏选择-t