tar

Extract gnutls library files of tar.xz and tar.lz for ubuntu 10.04 LTS

给你一囗甜甜゛ 提交于 2020-01-12 13:45:07
问题 I am very new to linux platform and I want to extract gnutls for ubuntu. If I do, $ls then, it will show these files below. gnutls-3.2.1.tar.lz gnutls-3.2.1.tar.lz.sig gnutls-3.2.1.tar.xz gnutls-3.2.1.tar.xz.sig When I give command, $ tar -xvf gnutls-3.2.1.tar.xz I get output, tar: xz: Cannot exec: No such file or directory tar: Error is not recoverable: exiting now tar: Child returned status 2 tar: Exiting with failure status due to previous errors I want to extract these files. Why there

tar指令

假如想象 提交于 2020-01-12 09:30:42
** Linux常见的压缩格式:** gzip ------》.gz bzip2 ------》.bz2 xz ------》.xz 制作tar包 命令格式: tar 选项 压缩包名字 被压缩归档的源数据 .. .. .. tar 选项 -c:创建归档 -x:释放归档 -f:指定归档文件名称 -z、-j、-J:调用 .gz、.bz2、.xz 格式的工具进行处理 -t:显示归档中的文件清单 -C(大写):指定释放的位置 f:选项必须放在所有选项的最后 更多选项您可以自行man tar 查询 == 如果要查看包里的内容可以使用less命令== 仅解开单一档案的方法 如果我只想要解开打包档案内的其中一个档案而已, 那该如何做呢? # 1.先找到我们要的档名,假设解开shadow档案好了: [root@study ~] # tar -jtv -f /root/etc.tar.bz2 | grep 'shadow' -- - -- - -- - - root / root 721 2015 - 06 - 17 00:20 etc / gshadow -- - -- - -- - - root / root 1183 2015 - 06 - 17 00:20 etc / shadow - -- - -- - -- - - root / root 1210 2015 - 06 - 17 00

Linux tar打包命令详解

試著忘記壹切 提交于 2020-01-11 23:32:55
本文转载自: http://www.ryxxff.com/10399.html Linux 系统中,最常用的归档(打包)命令就是 tar,该命令可以将许多文件一起保存到一个单独的磁带或磁盘中进行归档。不仅如此,该命令还可以从归档文件中还原所需文件,也就是打包的反过程,称为解打包。 使用 tar 命令归档的包通常称为 tar 包(tar 包文件都是以“.tar”结尾的)。 tar命令做打包操作 当 tar 命令用于打包操作时,该命令的基本格式为: [root@localhost ~]#tar [选项] 源文件或目录 此命令常用的选项及各自的含义如下: -c 将多个文件或目录进行打包。 -A 追加 tar 文件到归档文件。 -f 包名指定包的文件名。包的扩展名是用来给管理员识别格式的,所以一定要正确指定扩展名; -v 显示打包文件过程; 需要注意的是,在使用 tar 命令指定选项时可以不在选项前面输入“-”。例如,使用“cvf”选项和 “-cvf”起到的作用一样。 下面给大家举几个例子,一起看看如何使用 tar 命令打包文件和目录。 【例 1】打包文件和目录。 [root@localhost ~]# tar -cvf anaconda-ks.cfg.tar anaconda-ks.cfg #把anacondehks.cfg打包为 anacondehks.cfg.tar文件 选项 "

Create a tar.xz in one command

ぐ巨炮叔叔 提交于 2020-01-11 14:47:48
问题 I am trying to create a .tar.xz compressed archive in one command. What is the specific syntax for that? I have tried tar cf - file | xz file.tar.xz , but that does not work. 回答1: Use the -J compression option for xz . And remember to man tar :) tar cfJ <archive.tar.xz> <files> Edit 2015-08-10: If you're passing the arguments to tar with dashes (ex: tar -cf as opposed to tar cf ), then the -f option must come last , since it specifies the filename (thanks to @A-B-B for pointing that out!). In

How do I prevent tar from overwriting an existing archive?

主宰稳场 提交于 2020-01-11 06:21:13
问题 I backup files a few times a day on Ubuntu/Linux with the command tar -cpvzf ~/Backup/backup_file_name.tar.gz directory_to_backup/ , (the file name contains the date in YYYY-MM-DD format and a letter from a to z - a is the first backup for this date etc.) but I want to create a new archive, not overwrite the archive if it already exists. How do I prevent tar from overwriting an existing archive? If the archive exists, I want tar to exit without doing anything (and if possible, display an

How do I prevent tar from overwriting an existing archive?

那年仲夏 提交于 2020-01-11 06:20:08
问题 I backup files a few times a day on Ubuntu/Linux with the command tar -cpvzf ~/Backup/backup_file_name.tar.gz directory_to_backup/ , (the file name contains the date in YYYY-MM-DD format and a letter from a to z - a is the first backup for this date etc.) but I want to create a new archive, not overwrite the archive if it already exists. How do I prevent tar from overwriting an existing archive? If the archive exists, I want tar to exit without doing anything (and if possible, display an

untarring files to S3 fails, not sure why

a 夏天 提交于 2020-01-11 04:03:09
问题 (new information below) I am trying to set up a lambda function that reacts to uploaded tgz files by uncompressing them and writing the results back to S3. The unzip and untar work fine, but uploading to S3 fails: /Users/russell/lambda/gzip/node_modules/aws-sdk/lib/s3/managed_upload.js:350 var buf = self.body.read(self.partSize - self.partBuffer.length) || ^ TypeError: undefined is not a function at ManagedUpload.fillStream (/Users/russell/lambda/gzip/node_modules/aws-sdk/lib/s3/managed

gzip: stdin: not in gzip format

隐身守侯 提交于 2020-01-10 18:56:01
tar -zxvf memcacheq.tar.gz 出现一下错误: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now 可以将tar -xvf memcacheq.tar.gz 可能文件打包时没有压缩 来源: CSDN 作者: qq_20377691 链接: https://blog.csdn.net/qq_20377691/article/details/103928665

Why do the md5 hashes of two tarballs of the same file differ?

拈花ヽ惹草 提交于 2020-01-10 14:14:08
问题 I can run: echo "asdf" > testfile tar czf a.tar.gz testfile tar czf b.tar.gz testfile md5sum *.tar.gz and it turns out that a.tar.gz and b.tar.gz have different md5 hashes. It's true that they're different, which diff -u a.tar.gz b.tar.gz confirms. What additional flags do I need to pass in to tar so that its output is consistent over time with the same input? 回答1: tar czf outfile infiles is equivalent to tar cf - infiles | gzip > outfile The reason the files are different is because gzip

批量解压

强颜欢笑 提交于 2020-01-09 11:16:45
ls *.tar.gz | xargs -n1 tar xzvf 一、批量解压bz2文件 find -maxdepth 1 -name "*.bz2"|xargs -i tar xvjf {} 这条命令可解压当前目录下的所有bz2文件 批量解压是比较郁闷的事,以前尝试各种方法,甚至用脚本循环语句解压都不行 现在发现这条命令可以搞定,maxdepth表示搜索深度,1代表只搜索当前目录 二、批量解压gz文件(第二个方法最简单) 第一: for tar in *.tar.gz; do tar xvf $tar; done for tar in *.tar.bz2; do tar xvf $tar; done 第二:用tar命令批量解压某个文件夹下所有的tar.gz文件 ls *.tar.gz | xargs -n1 tar xzvf 第三:find -maxdepth 1 -name “*.bz2″|xargs -i tar xvjf {} 这条命令可解压当前目录下的所有bz2文件,maxdepth表示搜索深度,1代表只搜索当前目录 第四:for i in $(ls *.tar);do tar xvf $i;done 来源: https://www.cnblogs.com/wenter2016/p/12169880.html