『楼 主』:
DOS下常用压缩和解压工具的使用[原创]
使用 LLM 解释/回答一下
大家知道,为了保存文件且节省空间的占用,往往对文件进行压缩。而且,由于文件被压缩后通常只剩下了一个压缩文件,便于携带,还可以进行密码保护,所以文件的压缩及解压成了大家经常用到的一项操作,可以在本站“DOS使用”栏目中看到。那么如何进行这些操作呢?下面就介绍一下DOS下压缩/解压的方法。
由于压缩软件的不同,压缩文件也有好几种,最常见的压缩格式有ZIP、RAR、ARJ等等。尤其是ZIP格式,用得最为广泛,本站的软件中大多数就是这种格式。DOS下对这些ZIP文件进行压缩操作的工具有很多,如PKZIP、InfoZIP等等,其中最有名且最实用的是PKZIP/PKUNZIP工具,它的最新版本是2.50版,可在本站的“压缩软件”中下载,运行其中的自解压文件,然后就可以直接使用了,而不需要进行安装。有些人用过WinZip、WinRAR等工具,从安装到使用,通常需要进行一系列的步骤才能完成一项操作,而PKZIP/PKUNZIP则大不一样,它继承了DOS方便实用的特点,使用起来非常容易,通常一条命令就可以完成对ZIP的相应操作,快速高效。而且,PKZIP/PKUNZIP 2.50的功能也十分强大,不仅操作十分全面,而且完全支持文件列表和长文件名。以下列出PKZIP/PKUNZIP的用法和常用命令行参数:
PKZIP ZIP文件名
其中,常用的选项有(不区分大小写):
-a 向压缩文件中添加文件.
-d 从压缩文件中删除文件.
-f 刷新压缩文件中的文件.
-u 更新压缩文件中的文件.
-p 存储进行压缩的文件的相对路径.
-r 记住进行压缩的文件的所在路径结构.
-s 设置压缩文件的密码.
-v 查看压缩文件中的内容.
-x 压缩时排除指定的文件.
-z 添加或修改压缩文件的注解.
例如:PKZIP -A -S:FILE BMPS.ZIP D:\*.BMP,此命令将D:\下所有扩展名为BMP的文件压缩后加入到BMPS.ZIP文件中,并设置压缩密码为“FILE”。
如果没有指定选项的话,则自动向ZIP压缩文件中进行添加/更新文件的操作;如果没有指定要压缩的文件名的话,则默认对当前文件夹下的所有文件进行操作。比如:PKZIP FILES.ZIP即可将当前文件夹下的所有文件压缩后加入到FILES.ZIP中。
PKUNZIP ZIP文件名
其中,常用的选项有(不区分大小写):
-d 恢复压缩文件中所储存的路径结构.
-e 从压缩文件中解压文件.
-f 刷新解压出来的文件.
-o 若已存在此文件的话解压时直接进行覆盖操作.
-s 输入压缩文件的密码以进行解压.
-t 测试压缩文件的完整性.
-v 查看压缩文件中的内容.
-x 解压时排除指定的文件.
例如:PKUNZIP -D -S:FILE BMPS.ZIP *.BMP即可将BMPS.ZIP文件中所有扩展名为BMP的文件解压出来,保留原有文件的路径,并输入当时设置的密码“FILE”以解压。
如果没有指定选项的话,则自动从ZIP压缩文件进行解压文件的操作;如果没有指定要解压的文件名的话,则默认对压缩文件夹中的所有文件进行操作。比如:PKUNZIP FILES.ZIP即可将FILES.ZIP文件中所有的文件进行解压。
可见,上面的PKZIP和PKUNZIP的操作十分相似(不过,PKUNZIP完全支持通配任,而PKZIP中指定的ZIP压缩文件名不能为通配符),但结果正好相反。由于它们的操作十分简便实用,因此,大家使用它们一会儿后就会觉得操作起来是十分容易的。
另外,PKZIP中还自带有PKZIPFIX等工具,可以对ZIP文件进行修复等操作。
对于RAR格式的文件,可以用RAR 3.0进行压缩和解压。它全面支持长文件名和最新的RAR文件压缩方法(不像RAR 2.50就不支持),也可在本站的“压缩软件”中下载。下面列出了RAR 3.0的命令行操作方法:
RAR RAR文件名
其中,常用的命令有:
a 向压缩文件中添加文件.
c 添加压缩文件的注解.
e 将压缩文件中的文件解压到当前文件夹下.
f 刷新压缩文件中的文件.
l 列出压缩文件中的内容.
t 测试压缩文件的完整性.
r 修复损坏的压缩文件.
x 将压缩文件中的文件解压到压缩文件中保存的文件夹下.
常用的选项有:
-m 设置压缩级别,从0到5.
-p 设置或输入压缩文件的密码.
-r 记住进行压缩的文件的所在路径结构.
-u 更新压缩文件中的文件.
由于它的操作方法和上面的ZIP文件的操作十分相似,在此就不再举例了。
对于ARJ压缩文件,它的操作与上面的RAR几乎完全相同,可参照RAR的命令和选项。还有其它一些压缩格式的文件,如TAR、GZIP、ARC、ACE等等,也可以分别用相应的工具(如UNTAR、UNARC、UNACE等等)来完成其压缩/解压等操作。
以上是DOS下常见的压缩工具的使用,大家可以使用它们进行各种压缩/解压操作。
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.
|