我不明白为什么这个bash代码不起作用。
find -type f | grep file_ | xargs -0 -I file tar -zxf file --directory /tmp
我遇到此错误:
tar (child): ./file_ok.tar.gz\n : open
impossible: No file or folder of this type
tar (child): Error is not recoverable:
exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
答案 0 :(得分:0)
感谢JNevill,该命令有效,我们可以在find命令中执行所有这些操作
find -type f -name "*file_*" -exec tar -zxf {} --directory /tmp \;