我想知道使用什么命令来递归地将目标目录中的所有文件进行 gunzip 压缩?我尝试使用 unzip 命令,但没有用。
我尝试了从目标文件夹中解压缩所有 zip 文件的命令?
hee*_*ayl 84
gunzip有-r选择。来自man gunzip:
-r --recursive
Travel the directory structure recursively. If any of the
file names specified on the command line are directories, gzip
will descend into the directory and compress all the files it finds
there (or decompress them in the case of gunzip ).
Run Code Online (Sandbox Code Playgroud)
因此,如果您想将目录及其所有子目录中的gunzip所有压缩文件(gunzip当前可以解压缩由 gzip、zip、compress、compress -H 或 pack 创建的文件)/foo/bar:
gunzip -r /foo/bar
Run Code Online (Sandbox Code Playgroud)
这也将处理带有空格的文件名。
A.B*_*.B. 19
使用下面的命令。替换<path_of_your_zips>为 ZIP 文件的路径和<out>目标文件夹:
对于 GZ 文件
find <path_of_your_zips> -type f -name "*.gz" -exec tar xf {} -C <out> \;
Run Code Online (Sandbox Code Playgroud)
或者
find <path_of_your_zips> -type f -name "*.gz" -print0 | xargs -0 -I{} tar xf {} -C <out>
Run Code Online (Sandbox Code Playgroud)对于 ZIP 文件
find <path_of_your_zips> -type f -name "*.zip" -exec unzip {} -d <out> \;
Run Code Online (Sandbox Code Playgroud)
或者
find <path_of_your_zips> -type f -name "*.zip" -print0 | xargs -0 -I{} unzip {} -d <out>
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
96292 次 |
| 最近记录: |