用于将单独文件夹中的 zip 文件解压缩到它们自己的文件夹的脚本 [英] Script to extract zip files in seperate folders to their own folders

查看:36
本文介绍了用于将单独文件夹中的 zip 文件解压缩到它们自己的文件夹的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数百个文件夹,每个文件夹都包含一个 zip 文件.我想将每个 zip 文件解压缩到它们所在的位置.有没有简单的技巧或脚本来做到这一点?

I have hundreds of folders each containing a zip file. I would like to extract each zip file to where they are located. Is there a simple trick or script to do this?

每个文件夹都在同一个父文件夹下.所以层次结构如下:

Each folder is under the same parent folder. So the hierarchy is as the following:

PARENT FOLDER
-SubFolder1
--somefile.zip
-Subfolder2
--somefile.zip
...
-SubfolderN
--somefile.zip

推荐答案

在 unix 下你可以使用类似

Under unix you could use something like

找到<目录>-iname '*.zip' -execdir unzip {} \;

程序 find 递归地遍历 <dir> 并且在它找到的每个 .zip 文件上,它将更改为该文件目录并对其执行解压缩.

The program find traverses <dir> recursively and on every .zip file it finds it will change to that files directory and executes unzip on it.

这篇关于用于将单独文件夹中的 zip 文件解压缩到它们自己的文件夹的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆