Linux 下压缩与解压.zip和.rar及.7z文件( 二 )


[Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit Y
Extracting 1.jpg;;OK
7a008fc287fe680c0ff477e9.jpg already exists. Overwrite it ?
[Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit Y
Extracting 2.jpg;;OK
All OK
yajiu@yajiu-desktop:~/图片$
原文链接:http://hi.baidu.com/zgyz/blog/item/f7ef29085c90d4d663d98665.html
2)对于.7z
支持 7Z,ZIP,Zip64,CAB,RAR,ARJ,GZIP,BZIP2,TAR,CPIO,RPM,ISO,DEB 压缩文件格式
安装: sudo apt-get install p7zip p7zip-full p7zip-rar
# 7z a yajiu.7z yajiu.jpg yajiu.png
这条命令是将yajiu.jpg和yajiu.png压缩成一个7z包
# 7z a yajiu.7z *.jpg
这条命令是将所有.jpg的文件压缩成一个7z包
# 7z a yajiu.7z yajiu
这条命令是将文件夹yajiu压缩成一个7z包
# 7z e yajiu.7z
这条命令是将yajiu.7z中的所有文件解压出来,e是解压到当前路径
# 7z x yajiu.7z
这条命令是将yajiu.7z中的所有文件解压出来,x是解压到压缩包命名的目录下
yajiu@yajiu-desktop:~$ cd 图片
yajiu@yajiu-desktop:~/图片$ 7z a yajiu.7z yajiu.jpg yajiu.png
7-Zip (A) 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05
p7zip Version 4.58 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
Scanning
Creating archive yajiu.7z
Compressing yajiu.jpg;;
Compressing yajiu.png;;
Everything is Ok
yajiu@yajiu-desktop:~/图片$ 7z a yajiu.7z *.jpg
7-Zip (A) 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05
p7zip Version 4.58 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
Scanning
Creating archive yajiu.7z
Compressing 1.jpg;;
Compressing 2.jpg;;
Everything is Ok
yajiu@yajiu-desktop:~/图片$ 7z a yajiu.7z yajiu
7-Zip (A) 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05
p7zip Version 4.58 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
Scanning
Creating archive yajiu.7z
Compressing yajiu/yajiu.7z;;
Compressing yajiu/yajiu.rar;;
Compressing yajiu/yajiu.zip;;
Compressing yajiu/yajiu.jpg;;
Compressing yajiu/yajiu.png;;
Everything is Ok
yajiu@yajiu-desktop:~/图片$ 7z x yajiu.7z
7-Zip 4.58 beta Copyright (c) 1999-2008 Igor Pavlov 2008-05-05
p7zip Version 4.58 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
Processing archive: yajiu.7z
file 1.jpg
already exists. Overwrite with
1.jpg?
(Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename / (Q)uit? Y
Extracting 1.jpg
file 2.jpg
already exists. Overwrite with
2.jpg?
(Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename / (Q)uit? Y
Extracting 2.jpg
Everything is Ok
Files: 2
Size:;;;;112564
Compressed: 96228
yajiu@yajiu-desktop:~/图片$

推荐阅读