wolbo
解压文件夹:unzip 压缩文件名.zip “*/目录名/*.*” -d 目标文件夹名字
解压指定的文件:unzip 压缩文件名.zip “*/文件名.后缀” -d 目标文件夹名字

以上解压会保留zip中的完整目录结构 如

unzip aaa.zip \'gscloud/gscloud/*\' -d /gscloud  
会得到 /gscloud/gscloud/gscloud/....

unzip -j 压缩文件名.zip “*/文件名.后缀” -d 目标文件夹名字 -j会忽略掉所有的目录结构

-o或覆盖掉已存在的文件

如果想得到strip \'gscloud/gscloud/*\' 的效果 只能先解压 再mv




参考:
https://unix.stackexchange.com/questions/59276/how-to-extract-only-a-specific-folder-from-a-zipped-archive-to-a-given-directory

分类:

技术点:

相关文章:

  • 2021-11-07
  • 2022-01-01
  • 2021-11-23
  • 2021-11-07
  • 2021-11-07
  • 2021-11-13
  • 2021-11-07
猜你喜欢
  • 2021-11-23
  • 2021-11-07
  • 2021-11-07
  • 2021-11-13
  • 2021-11-07
  • 2021-11-23
  • 2021-11-23
相关资源
相似解决方案