将子目录解压缩到一个目录中

时间:2017-05-26 13:44:57

标签: linux bash shell ubuntu unzip

我有一个目录,其中包含许多子目录1,2和更多级别的zip文件。

你能帮我解决一下命令,将子目录中的所有zip文件解压缩到一个名为/ set /的目录中吗?

我在Ubuntu上

1 个答案:

答案 0 :(得分:1)

使用父目录中的这个来将所有zip文件extratc到/ set:

find . -name "*.zip" -print | xargs -I{} unzip -o {} -d /path/to/set

如果您不想在/ set中设置子目录,可以使用/ set父目录:

find . -mindepth 1 -type f  -print0 | xargs -I{} mv {} /path/to/set