如何在 CentOS 上压缩和解压缩目录。

2025 年 3 月 17 日 | 阅读 1 分钟

引言

Zip 是一种支持无损数据压缩的归档文件格式。一个 .zip 文件可能包含任意数量的压缩文件。该格式由 Phil Katz1989 年创建。当需要传输大量数据时,压缩非常有用。大多数操作系统都以类似的方式内置了对 .zip 的支持。

压缩目录

我们创建了一个名为 example 的目录,并将 Pictures 目录复制到其中,该目录包含一些 JPG 文件。 执行 ls 命令列出文件。

CentOS How to zip and unzip directories on CentOS

可以通过执行以下命令将 Pictures 文件夹压缩为 pictures.zip

CentOS How to zip and unzip directories on CentOS 1

现在,如果我们列出文件,我们将获得一个新的压缩文件,名为 pictures.zip,这是执行先前命令的结果。

CentOS How to zip and unzip directories on CentOS 2

Unzip 目录

执行以下命令解压缩 pictures.zip。 该命令将在 example 目录中创建一个名为 Pictures 的目录。

CentOS How to zip and unzip directories on CentOS 3

额外信息

如果我们需要了解更多关于压缩和解压缩文件夹的信息,我们可以寻求帮助。 为此,执行以下命令。

CentOS How to zip and unzip directories on CentOS 4

因此,我们已经讨论了足够多的关于文件夹的压缩和解压缩的信息。


下一个主题安装 MongoDB