linux下如何解压zip文件

Liyingyue_FFS 2008-11-06 10:46:46
假设/home/user/test/路径下有大量的.zip文件,数量有几千个,怎样通过linux命令批量解压这些文件呢?
...全文
31865 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
十四大盗 2012-10-11
  • 打赏
  • 举报
回复
ls *.tar.gz | xargs -n1 tar xzvf
Bill_Xiang 2012-09-28
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 的回复:]
for i in *.zip
do
unzip $i
done;
[/Quote]
成功
sagapoxf 2012-09-02
  • 打赏
  • 举报
回复
看看,学习学习
wxq-1090691643 2011-12-12
  • 打赏
  • 举报
回复
vi一个文件unzip.sh
内容如下
for i in *.zip
do
unzip $i
rm -rf $i
done
保存后,sh unzip.sh就可以了


Liyingyue_FFS 2008-11-10
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 genghb 的回复:]
解压路径可以使用man unzip 查看文档,找到解压输出路径参数

删除可以使用如下脚本
for i in *.zip
do
unzip $i
rm $i ##
done;
[/Quote]
thanks
Liyingyue_FFS 2008-11-10
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 genghb 的回复:]
解压路径可以使用man unzip 查看文档,找到解压输出路径参数

删除可以使用如下脚本
for i in *.zip
do
unzip $i
rm $i ##
done;
[/Quote]
thanks
Liyingyue_FFS 2008-11-07
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 genghb 的回复:]
for i in *.zip
do
unzip $i
done;
[/Quote]

这个已经试验成功,可以批量解压。
再问,unzip有没有参数控制在解压zip文件后删除该zip文件的?
love_aiqiu_123 2008-11-07
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xhs_lh04 的回复:]
zip?用gzip解压吧
写个shell

for file in `ls *.zip`
do
gzip -d $file
done
[/Quote] 厉害,不知道能不能行的通!!??
期待楼主的答案。。。。
genghb 2008-11-06
  • 打赏
  • 举报
回复
unzip 即可
once_and_again 2008-11-06
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 guosha 的回复:]
简单点
unzip *.zip
[/Quote]
unzip [-Z] [-cflptTuvz[abjnoqsCKLMVWX$/:]] file[.zip] [file(s) ...]
[-x xfile(s) ...] [-d exdir]
快乐田伯光 2008-11-06
  • 打赏
  • 举报
回复
简单点
unzip *.zip
Liyingyue_FFS 2008-11-06
  • 打赏
  • 举报
回复
可以说下对于我上面的那个例子应该怎么做么?只了解简单的linux命令,没有接触过shell
fox000002 2008-11-06
  • 打赏
  • 举报
回复
zip 的话还是用 unzip

for file in `ls *.zip`;do unzip $file; done
xhs_lh04 2008-11-06
  • 打赏
  • 举报
回复
zip?用gzip解压吧
写个shell

for file in `ls *.zip`
do
gzip -d $file
done
平平 2008-11-06
  • 打赏
  • 举报
回复
unzip 就可以用了
不过需要安装的
genghb 2008-11-06
  • 打赏
  • 举报
回复
for i in *.zip
do
unzip $i
done;
Liyingyue_FFS 2008-11-06
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 genghb 的回复:]
如果是多个文件 需要输入文件名
unzip 123.zip
unzip 223.zip
[/Quote]
就是问是否有批量修改的方法,因为需要解压5000以上的zip文件
genghb 2008-11-06
  • 打赏
  • 举报
回复
如果是多个文件 需要输入文件名
unzip 123.zip
unzip 223.zip
Liyingyue_FFS 2008-11-06
  • 打赏
  • 举报
回复
sybiq@linux:~/ziptest> ls
123.zip 223.zip
sybiq@linux:~/ziptest> unzip *.zip
Archive: 123.zip
caution: filename not matched: 223.zip
sybiq@linux:~/ziptest> ls
123.zip 223.zip


unzip *.zip 执行失败啊
joyself 2008-11-06
  • 打赏
  • 举报
回复
unzip *.zip

23,216

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧