tar

How do I extract a tar file using python 2.4?

我怕爱的太早我们不能终老 提交于 2019-12-19 05:17:15
问题 I'm trying to extract a .tar file completely using python 2.4.2 and because of this not all of the aspects of the tarfile module are usable. I've looked through the python documentary and I have not found it to be helpful as I continue to make syntax errors. The following are commands I have tried(to no success): tarfile.Tarfile.getnames(tarfile.tar) tarfile.Tarfile.extract(tarfile.tar) Is there a simple way to extract my tar completely? If so what is the formatting used? Also, I'd like to

Add files and repertories to a Tar archive with Apache Commons Compress library in non machine dependent way

扶醉桌前 提交于 2019-12-19 04:38:09
问题 I'm working on an application that need to create a tar archive in order to calculate his hash. But I encounter some problems : the tar is not the same in different machine, then the hash calculated is different I'm not able to add directories properly If I add an zip file, at the end, in the tar, I have the content off my zip file :/ I have read different post in SO and the dedicated tutorial on apache, and also the source test code of the apache commons compress jar, but I don't get the

cenos基本信息和ssh

为君一笑 提交于 2019-12-18 23:47:55
cenos基本信息和ssh CentOS CentOS 是一个基于Red Hat Linux 提供的可自由使用源代码的企业级Linux发行版本。每个版本的 CentOS都会获得十年的支持(通过安全更新方式)。新版本的 CentOS 大约每两年发行一次,而每个版本的 CentOS 会定期(大概每六个月)更新一次,以便支持新的硬件。这样,建立一个安全、低维护、稳定、高预测性、高重复性的 Linux 环境。CentOS是Community Enterprise Operating System的缩写。 CentOS 是RHEL(Red Hat Enterprise Linux)源代码再编译的产物,而且在RHEL的基础上修正了不少已知的 Bug ,相对于其他 Linux 发行版,其稳定性值得信赖。 CentOS在2014初,宣布加入Red Hat。 新版本为 CentOS 7.6(1810) [1] 。上个版本是7.5(1804)。 最新版本特点: 1.可以把CentOS理解为Red Hat AS系列!它完全就是对Red Hat AS进行改进后发布的!各种操作、使用和RED HAT没有区别! 2.CentOS完全免费,不存在RED HAT AS4需要序列号的问题。 3.CentOS独有的yum命令支持在线升级,可以即时更新系统,不像RED HAT那样需要花钱购买支持服务! 4

How can I decompress an archive file having tar.zst?

二次信任 提交于 2019-12-18 18:51:12
问题 I do not know how I can decompress a file having tar.zst extension and even though I did look for solutions on the Internet I ended up having nothing useful regarding the matter. 回答1: The extention .zst means that the archive is compressed by zstd. https://github.com/facebook/zstd The tar command has an option -I (--use-compress-program) to specify a command for compression/decompression. You can use it as follows. $ tar -I zstd -xvf archive.tar.zst 回答2: Decompress it in Terminal. unzstd

Installing VTK for Python

 ̄綄美尐妖づ 提交于 2019-12-18 14:55:56
问题 I'm trying to install VTK module for python, I am however unsuccesful in doing so. I have downloaded a VTK tar-file, but I'm unable to extract it. I'm capable of extracting other tar-files, so there must be something specific with this file I suppose. This is my error: gzip: stdin: invalid compressed data--format violated tar: Child returned status 1 tar: Error is not recoverable: exiting now I hope somebody can help me with this. 回答1: The answer depends on the operating system you are using.

文档压缩

懵懂的女人 提交于 2019-12-18 12:02:28
一、文档的压缩与打包 ,gz:表示由gzip压缩工具压缩的文件 ,bz2:表示由bzip2压缩工具压缩的文件 ,tar:表示由tay打包程序打包的文件(tar并没有压缩功能,只是吧一个目录合并成一个文件) ,tar,gz:可以理解为现有tar打包,然后再由gzipyasuo .tar,bz2:可以理解为先由tar打包,然后再由bzip2压缩 ,tar,xz:可以理解为先由tar打包,然后再xz压缩 1,gzip压缩工具:格式为gzip [-d#] filename -d:该参数在解压缩时使用 gzip后面直接跟文件名,表示在当前目录下压缩该文件,而原文件也会消失 -#:表示压缩等级,1为最差,9为最好,6为默认 命令gzip-d后面跟压缩文件表示解压缩文件,gzip不支持压缩目录,压缩目录时会报错 2,bzip2压缩工具:格式为bzip2 [-dz] filename 只有-z(压缩)和-d(解压缩)俩个常用选项,压缩级别有1~9,默认级别时9,压缩时,加不加-z选项都可以压缩文件 如果没有找到该命令须先安装yum -y install bzip2 bzip2命令也不可以压缩目录,压缩目录时会报错 3,xz压缩工具:格式为xz [-dz] filename 有-z(压缩)和-d(解压缩)俩个常用选项,压缩级别有1~9,默认级别时9,压缩时,加不加-z选项都可以压缩文件

linux:文件打包与压缩

元气小坏坏 提交于 2019-12-18 11:28:36
学习内容介绍:Linux 上常用的压缩/解压工具,介绍了zip、rar、tar的使用。 先总结一下常用命令: zip: 打包 :zip something.zip something (目录请加 -r 参数) 解包:unzip something.zip 指定路径:-d 参数 tar: 打包:tar -zcvf something.tar something 解包:tar -zxvf something.tar/something.tar.gz 指定路径:-C 参数 文件打包和压缩 Linux 上的压缩包文件格式,除了 Windows 最常见的*.zip、*.rar、.7z 后缀的压缩文件,还有 .gz、.xz、.bz2、.tar、.tar.gz、.tar.xz、tar.bz2 文件后缀名 说明 *.zip zip 程序打包压缩的文件 *.rar rar 程序压缩的文件 *.7z 7zip 程序压缩的文件 *.tar tar 程序打包,未压缩的文件 *.gz gzip 程序 (GNU zip) 压缩的文件 *.xz xz 程序压缩的文件 *.bz2 tar 打包,gzip 程序压缩的文件 *.tar.gz tar打包,gzip程序压缩的文件 *.tar.xz tar打包,xz程序压缩的文件 *.tar.bz2 tar打包,bzip2程序压缩的文件 *.tar.7z tar打包

Difference between two .tar.gz file lists on linux

我怕爱的太早我们不能终老 提交于 2019-12-18 10:35:22
问题 Having two different .tar.gz files: The second .tar.gz is the subset of first .tar.gz. I need a single line command to find the missing files in second .tar.gz. E.g.: 1.tar.gz file list: 1.jsp 2.txt 3.htm 2.tar.gz file list: 1.jsp 3.htm output should be: 2.txt 回答1: Just list the contents and do diff : diff <(tar -tvf 1.tar.gz | sort) <(tar -tvf 2.tar.gz | sort) 来源: https://stackoverflow.com/questions/13156383/difference-between-two-tar-gz-file-lists-on-linux

Listing the content of a tar file or a directory only down to some level

自闭症网瘾萝莉.ら 提交于 2019-12-18 10:03:54
问题 I wonder how to list the content of a tar file only down to some level? I understand tar tvf mytar.tar will list all files, but sometimes I would like to only see directories down to some level. Similarly, for the command ls , how do I control the level of subdirectories that will be displayed? By default, it will only show the direct subdirectories, but not go further. 回答1: tar tvf scripts.tar | awk -F/ '{if (NF<4) print }' drwx------ glens/glens 0 2010-03-17 10:44 scripts/ -rwxr--r-- glens

How to grep for a pattern in the files in tar archive without filling up disk space

别说谁变了你拦得住时间么 提交于 2019-12-18 04:55:17
问题 I have a tar archive which is very big ~ 5GB. I want to grep for a pattern on all files (and also print the name of the file that has the pattern ) in the archive but do not want to fill up my disk space by extracting the archive. Anyway I can do that? I tried these, but this does not give me the file names that contain the pattern, just the matching lines: tar -O -xf test.tar.gz | grep 'this' tar -xf test.tar.gz --to-command='grep awesome' Also where is this feature of tar documented? tar xf