我使用zip命令行和-r选项压缩了Mac上的一个目录。我将.zip scp到一个在Linux上运行的集群。
如果我尝试用以下命令解压缩.zip
tar -vxzf foo.zip
在我的机器上它可以工作。但是相同的命令在集群上不起作用。我得到了错误
gzip: stdin has more than one entry--rest ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now
我该如何解决这个问题?
我有一堆扩展名为.zip的文件,这些文件在我的HPC上似乎无法提取:
$ unzip RowlandMetaG_part1.zip
Archive: RowlandMetaG_part1.zip
warning [RowlandMetaG_part1.zip]: 13082642473 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [RowlandMetaG_part1.zip]: start of central directory not found;
zipfi
我在下面的代码中尝试使用python为位于给定目录的所有文件创建简单的tar文件。
在目录D:/tmp/中,只有一些常规文件,其中没有子目录。
import os
import tarfile
def createTar(path, tar_name):
with tarfile.open(tar_name, "w:gz") as tar_obj:
for root, dirs, files in os.walk(path):
for file in files:
tar_obj.add(os.p
我有一个很大的大约10 to的zip文件,它是使用标准的Windows方法创建的(右键单击,选择“发送到压缩(zipped)文件夹”)。我可以把它解压到我的Macbook上。
我正试着在EC2机器上解压。我知道这个文件是一个压缩文件,因为当我运行file file.zip时,它会说:
file.zip: Zip archive data, at least v2.0 to extract
运行unzip将返回以下错误:
Archive: file.zip
warning [file.zip]: 3082769992 extra bytes at beginning or within zi
我有一个csv文件被压缩和压缩。所以我有test.tar.gz。
我想,通过文本文件输入,读取csv文件。
我尝试这个tar:gz:file://C:/test/test.tar.gz!/test.tar!使用通配符,比如".*\.csv".
但有时却看不出成功。
它抛出异常
org.apache.commons.vfs.FileNotFolderException:
Could not list the contents of
"tar:gz:file:///C:/test/test.tar.gz!/test.tar!/"
because it
在Linux中,有关这些版本的“tar”命令:
tar -tzf /path/to/filename.tar.gz # Show the content
tar -xzf /path/to/filename.tar.gz # Extract the content
观察这两个命令使用z选项,很好,它们按照预期工作。
通过man tar,关于z选项,它指示:
-z, --gzip, --gunzip, --ungzip
Filter the archive through gzip(1).
问题
为什么tar命令通过'z'选项使用gzip命令?
E
我正在尝试编写一个脚本,使tar与文件夹保持同步。我正在处理很多文件,不想在每次运行脚本时都重新生成tar。我希望它只在tar中添加/删除自上次脚本运行以来从文件夹中添加/删除的文件。这就是我所拥有的。
# Create tar if it doesn't exist but don't over write if it does exist
touch -a /home/MyName/data.tar
cd /home/MyName
# Make the tar
tar -uv --exclude='dirToTar/FileIWantToExclude'
我有一个包含tar.gz文件的压缩文件。我想要访问tar.gz文件的内容,但不需要解压缩它 我可以列出zip文件中的文件,但当然,当尝试解压其中一个文件时,bash会说:“无法打开:没有这样的文件或目录”,因为该文件不存在 for file in $archiveFiles;
#do echo ${file: -4};
do
if [[ $file == README.* ]]; then
echo "skipping readme, not relevant"
elif [[ $
我刚开始使用ubuntu (上周就有了),我在打开.tar文件时遇到了麻烦。它产生了这样的错误:
tar (child): tor-browser-linux64-6.0.3_en-US.tar.xz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
我已经尝试了许多文件,但这是相同的错误。这可能是简单的事情,但我不习惯操
来自https://dzone.com/articles/java-8-how-to-create-executable-fatjar-without-ide
tar xf ExecutableOne.jar
但为什么我要
$ tar xf ExecutableOne.jar
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
谢谢。
我下载了'jdk-7u55-linux-x64.tar.gz‘
当我执行以下命令解压缩时,
sudo tar xvzf jdk-7u55-linux-x64.tar.gz
也试过了,
sudo tar xvf jdk-7u55-linux-x64.tar.gz
sudo tar xf jdk-7u55-linux-x64.tar.gz
sudo tar -xvf jdk-7u55-linux-x64.tar.gz
但我终于犯了错误,
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unex