Home

zhangyiqun

Thoughts, stories and ideas.

Notes Blog Archives About
13 Jan 2010

如何在Linux下使用zip切割文件?

如何在linux下实现Windows中winrar和winzip等压缩软件所提供的打包压缩分割功能,因为朋友使用win系统必须得保证切出来的东西他也可用,为此特意找了下相关命令,最终发现了zipsplit

以下内容来自 centos

[root@wx1 ~]# zipsplit -h

Copyright (C) 1990-2005 Info-ZIP

Type ‘zipsplit “-L”‘ for software license.

ZipSplit 2.31 (March 8th 2005)

Usage: zipsplit [-tips] [-n size] [-r room] [-b path] zipfile

-t report how many files it will take, but don’t make them

-i make index (zipsplit.idx) and count its size against first zip file

-n make zip files no larger than “size” (default = 36000)

-r leave room for “room” bytes on the first disk (default = 0)

-b use “path” for the output zip files

-p pause between output zip files

-s do a sequential split even if it takes more zip files

-h show this help -v show version info -L show software license

[root@wx1 ~]# zipsplit -t -i -n 100m -b LargeSplit LargeFile.zip

zipsplit error: Entry too big to split, read, or write (-)

[root@wx1 ~]# ll -h LargeFile.zip

-rw-r–r– 1 root root 1.4G Jun 17 08:51 LargeFile.zip

[root@wx1 C5]# rpm -qif `which zipsplit `

Name : zip Relocations: (not relocatable)

Version : 2.31 Vendor: CentOS

Release : 2.el5 Build Date: Wed 11 Mar 2009 04:34:27 PM EDT

Install Date: Fri 20 Mar 2009 01:32:51 PM EDT Build Host: chamkaur.karan.org

Group : Applications/Archiving Source RPM: zip-2.31-2.el5.src.rpm

Size : 318496 License: distributable

Signature : DSA/SHA1, Tue 17 Mar 2009 07:40:16 AM EDT, Key ID a8a447dce8562897

Packager : Karanbir Singh

URL : http://www.info-zip.org/pub/infozip/Zip.html

Summary : A file compression and packaging utility compatible with PKZIP.

Description :

The zip program is a compression and file packaging utility. Zip is

analogous to a combination of the UNIX tar and compress commands and

is compatible with PKZIP (a compression and file packaging utility for

MS-DOS systems).

Install the zip package if you need to compress files using the zip

program.

但是,很显然,它的功能非常的弱。相比之下rar则要强悍很多,以下例子是使用rar来创建一个加密压缩文件并切割成90000k/part

[jean@jeantoe Download]$ rar a -v90000 -pxxx Thunder.rar Thunder

Notes Blog Archives About