除了“解压”之外,还有其他的解压缩文件的select吗?

我的系统pipe理员现在无法访问,而且我想要解压缩服务器上的压缩文件…但是,我们目前没有安装zip和解压缩,而且我没有root用户来安装它们。 ..

我完全没有select吗? 还有其他的东西可以解压这个文件吗?

我还没有尝试过, 但是从1.6版本开始,Python的标准库中就有一个zipfile模块,而且从2.6版本开始,

应该能够做到这样的事情:

  1. 用下面的内容创build一个文件(编辑它以适合你的用例)。
  2. 将该文件保存为“unzipfile.py”
  3. 用python unzipfile.py运行

它会提取test.zip/home/user/directory

 import zipfile with zipfile.ZipFile('test.zip', "r") as z: z.extractall("/home/user/directory") 

资料来源: https : //stackoverflow.com/a/9432315/167299

另外, BusyBox包含一个解压“模块”,如果你可以下载并运行静态链接的BusyBox,那么你可以使用它来解压缩的东西。

如果你安装了javajar命令可以解压缩一个压缩文件:

 jar xvf file.zip 

请注意,您可以在无root权限的情况下安装java: http : //docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html

我不相信还有其他解压缩系统上的文件的方法,但是您可以将文件发送到另一个Linux系统(解压缩安装或根访问可用),在那里解压缩文件,并在必要时发送解压文件回原始服务器。

将文件从一台服务器发送到另一台服务器的命令是scp 。 发送文件的语法是:

 scp <filename> <username>@<otherhostname>:<portnumber><fullpathtolocation> eg: scp file.zip [email protected]:2222/home/user/ 

希望这可以帮助!

如果服务器运行Gnome,请使用归档实用程序

在这里输入图像说明

http://www.wikihow.com/Unzip-Files-in-Linux

将文件复制到另一台机器,解压缩并复制回来。

BSD / Mac OSX

随Mac和BSD派生的tar实用程序支持从tar命令中提取zip存档

 tar -xvf foo.zip tar --version bsdtar 2.8.3 - libarchive 2.8.3 

Debian / RHEL

Ubuntu和其他附带的tar档案不支持解压zip文件。 最好的select是将文件scp到安装了zip的机器上。

 tar -xvf foo.zip tar: This does not look like a tar archive tar: Exiting with failure status due to previous errors 

烟雾testing

 echo "the quick brown fox jumped over the lazy dog" > bar.txt zip -r bar.zip bar.txt rm bar.txt tar -xvf bar.txt cat bar.txt the quick brown fox jumped over the lazy dog 

更新

重写了答案,澄清tar -xvf只适用于bsd操作系统。 虽然这是一个很好的信息,但毕竟在这种情况下是行不通的。