China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 13:15
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Commonly Used Compression and Extraction Tools in DOS and Their Usage [Original] View 2,296 Replies 5
Original Poster Posted 2003-03-04 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Everyone knows that in order to save files and save space, files are often compressed. Moreover, since the compressed file usually leaves only one compressed file, which is easy to carry and can be password-protected, file compression and decompression have become a frequently used operation. You can see it in the "DOS Usage" section of this site. So how to perform these operations? The following introduces the methods of compression/decompression under DOS.

Due to different compression software, there are several types of compressed files. The most common compression formats are ZIP, RAR, ARJ, etc. Especially the ZIP format, which is used the most widely. Most of the software on this site is in this format. There are many tools for compressing these ZIP files under DOS, such as PKZIP, InfoZIP, etc. Among them, the most famous and practical one is the PKZIP/PKUNZIP tool. The latest version is version 2.50, which can be downloaded in the "Compression Software" of this site. Run its self-extracting file, and then you can use it directly without installation. Some people have used tools like WinZip, WinRAR, etc. From installation to use, usually a series of steps are required to complete an operation, while PKZIP/PKUNZIP is very different. It inherits the convenient and practical characteristics of DOS and is very easy to use. Usually, one command can complete the corresponding operation on ZIP, which is fast and efficient. Moreover, the functions of PKZIP/PKUNZIP 2.50 are also very powerful. Not only are the operations very comprehensive, but they also fully support file lists and long filenames. The following lists the usage and common command-line parameters of PKZIP/PKUNZIP:

PKZIP ZIP filename

Among them, the common options are (case-insensitive):

-a Add files to the compressed file.
-d Delete files from the compressed file.
-f Refresh the files in the compressed file.
-u Update the files in the compressed file.
-p Store the relative path of the file being compressed.
-r Remember the path structure where the file being compressed is located.
-s Set the password of the compressed file.
-v View the content in the compressed file.
-x Exclude specified files during compression.
-z Add or modify the annotation of the compressed file.
For example: PKZIP -A -S:FILE BMPS.ZIP D:\*.BMP. This command compresses all BMP files under D:\ and adds them to the BMPS.ZIP file, and sets the compression password to "FILE".

If no option is specified, it will automatically perform the operation of adding/updating files to the ZIP compressed file; if the filename to compress is not specified, it will default to operating on all files in the current folder. For example: PKZIP FILES.ZIP can compress all files in the current folder and add them to FILES.ZIP.

PKUNZIP ZIP filename

Among them, the common options are (case-insensitive):

-d Restore the path structure stored in the compressed file.
-e Decompress files from the compressed file.
-f Refresh the decompressed file.
-o If this file already exists, directly overwrite it during decompression.
-s Enter the password of the compressed file to decompress.
-t Test the integrity of the compressed file.
-v View the content in the compressed file.
-x Exclude specified files during decompression.

For example: PKUNZIP -D -S:FILE BMPS.ZIP *.BMP can decompress all BMP files in the BMPS.ZIP file, retain the original file path, and enter the password "FILE" set at that time to decompress.

If no option is specified, it will automatically perform the operation of decompressing files from the ZIP compressed file; if the filename to decompress is not specified, it will default to operating on all files in the compressed folder. For example: PKUNZIP FILES.ZIP can decompress all files in the FILES.ZIP file.

It can be seen that the operations of PKZIP and PKUNZIP above are very similar (however, PKUNZIP fully supports wildcards, and the ZIP compressed filename specified in PKZIP cannot be a wildcard), but the results are exactly the opposite. Because their operations are very simple and practical, everyone will find it very easy to operate after using them for a while.

In addition, PKZIP also has its own tools such as PKZIPFIX, which can repair ZIP files and other operations.

For RAR format files, RAR 3.0 can be used for compression and decompression. It fully supports long filenames and the latest RAR file compression method (unlike RAR 2.50 which does not support it), and can also be downloaded in the "Compression Software" of this site. The following lists the command-line operation method of RAR 3.0:

RAR RAR filename

Among them, the common commands are:

a Add files to the compressed file.
c Add the annotation of the compressed file.
e Decompress the files in the compressed file to the current folder.
f Refresh the files in the compressed file.
l List the content in the compressed file.
t Test the integrity of the compressed file.
r Repair the damaged compressed file.
x Decompress the files in the compressed file to the folder saved in the compressed file.

The common options are:

-m Set the compression level, from 0 to 5.
-p Set or enter the password of the compressed file.
-r Remember the path structure where the file being compressed is located.
-u Update the files in the compressed file.

Since its operation method is very similar to the operation of the above ZIP files, it will not be exemplified here.

For ARJ compressed files, its operation is almost exactly the same as RAR above, and can refer to the commands and options of RAR. There are also other types of compressed format files, such as TAR, GZIP, ARC, ACE, etc., which can also be completed with corresponding tools (such as UNTAR, UNARC, UNACE, etc.) for their compression/decompression and other operations.

The above is the use of common compression tools under DOS. You can use them to perform various compression/decompression operations.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 2 Posted 2003-03-31 00:00 ·  中国 吉林 吉林市 联通
初级用户
Credits 172
Posts 16
Joined 2003-03-31 00:00
23-year member
UID 1338
Gender Male
Status Offline
Floor 3 Posted 2003-03-31 00:00 ·  中国 吉林 吉林市 联通
初级用户
Credits 172
Posts 16
Joined 2003-03-31 00:00
23-year member
UID 1338
Gender Male
Status Offline
Floor 4 Posted 2003-03-31 00:00 ·  中国 山东 滨州 联通
高级用户
★★
Credits 948
Posts 271
Joined 2002-12-13 00:00
23-year member
UID 502
Gender Male
From sd
Status Offline
Floor 5 Posted 2003-05-11 00:00 ·  中国 湖北 武汉 联通(很多学校共享)
初级用户
Credits 126
Posts 5
Joined 2003-05-09 00:00
23-year member
UID 1967
Gender Male
Status Offline
Bump
Floor 6 Posted 2003-05-16 00:00 ·  中国 四川 成都 教育网
初级用户
Credits 294
Posts 49
Joined 2003-05-16 00:00
23-year member
UID 2138
Gender Male
Status Offline
Thanks
Forum Jump: