简体   繁体   English

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

[英]unzip sub directories into one directory

I have one directory with many sub directories 1,2 and more levels deep with zip files. 我有一个目录,其中包含许多子目录1,2,以及更多包含zip文件的目录。

Could you help me with command to unpack all the zip files in the subdirectories into one directory named /set/ ? 您能否通过命令帮助我将子目录中的所有zip文件解压缩到一个名为/ set /的目录中?

I am on Ubuntu 我在Ubuntu上

Use this from the parent directory to extratc all zip file to /set: 从父目录使用此命令将所有zip文件提取到/ set:

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

If you want no subdirectories in /set, you can use this from /set parent directory: 如果您不希望/ set中有子目录,可以在/ set父目录中使用它:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM