linux - 解压子目录到一个目录

标签 linux bash shell ubuntu unzip

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

你能帮我解压子目录中的所有 zip 文件到一个名为/set/的目录吗?

我在 Ubuntu 上

最佳答案

从父目录使用它来将所有 zip 文件解压到/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

关于linux - 解压子目录到一个目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44203205/

相关文章:

linux - 'none' 中的 "mount -t cgroup -o cpuset none/cpuset"是什么意思

当提供从网络接收到的字符串时,Curses printw() 将仅打印换行符

php - 使用 Linux 服务器 shell 命令按计划运行 php 脚本

bash - 如何突破源 Bash 脚本的功能

bash - 在具有特定扩展名的所有文件夹和子文件夹中运行命令

linux - Git Pull 无需输入私钥密码

c - 从 STM32F0 和 zlib 匹配 CRC32

Linux Red Hat Bash 是目录错误,试图在 Red Hat VI 中将一个文件值与另一个文件值相除

linux - 在 bash 脚本中回显变量时的 SIGPIPE

vim - 在不从 Vim 中过滤的情况下执行 shell 命令