Linux Mint 12 - 如何在终端中打开 .zip 文件

use*_*912 3 linux zip linux-mint

上面关于它的问题 - 非常抱歉,我一直看到答案,但是,虽然非常明确,但我无法将它们应用于我的终端。

我有一个压缩文件夹,我无法在存档中打开它:我收到以下错误:

Archive:  /home/elansa/Music/Music.zip
Zip file size: 2011856896 bytes, number of entries: 4693

warning [/home/elansa/Music/Music.zip]:  end-of-central-directory record claims this
  is disk 176 but that the central directory starts on disk 20153; this is a
  contradiction.  Attempting to process anyway.
error [/home/elansa/Music/Music.zip]:  missing 3025939027 bytes in zipfile
  (attempting to process anyway)
error [/home/elansa/Music/Music.zip]:  start of central directory not found;
  zipfile corrupt.
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
Run Code Online (Sandbox Code Playgroud)

我读到这种错误可以在终端中纠正。这是真的?如果可以,我可以指点迷津吗?我一直无法打开拉链。我不相信我是愚蠢的,但这只是逃避我。

任何帮助将不胜感激。

Ric*_*086 5

首先,您在帖子中列出的文件不是 .tar.gz 文件。它似乎是一个 ZIP 文件。ZIP 文件看起来也以某种方式损坏或不完整。

但是要回答您的问题,如果您确实有一个 .tar.gz 文件(假设您的主目录中有 music.tar.gz),您将像这样提取内容(这假设您与.tar.gz 文件)

tar -xzvf music.tar.gz
Run Code Online (Sandbox Code Playgroud)

这将在当前目录(您的主目录)中提取 .tar.gz 存档

-z : Uncompress the resulting archive with gzip command.
-x : Extract to disk from the archive.
-v : Produce verbose output i.e. show progress and file names while extracting files.
-f music.tar.gz : Read the archive from the specified file called music.tar.gz.
Run Code Online (Sandbox Code Playgroud)

有几个问题想请教您。您是在 Linux 系统上还是在 Windows 中创建了这个 zip 文件?我见过这样的情况,如果您使用 WinZIP 创建文件,出于某种奇怪的原因,当您尝试在 Linux 或 Mac OS X 上解压缩它时,存档将显示为不完整。如果您使用 WinZIP 在 Windows 中创建了 ZIP 文件,请尝试使用 WinZIP 在 Windows 中打开它,看看您是否至少可以看到存档中包含的文件列表。如果可以,请在 Windows 上解压缩文件并使用真正的存档工具(如 7 Zip 或 WinRAR)重新创建存档。

另一种选择是在 Linux 中的命令行中使用 unzip 命令。语法是

unzip music.zip
Run Code Online (Sandbox Code Playgroud)

这会将存档解压缩到当前文件夹中。