tar

tar命令exclude使用

喜夏-厌秋 提交于 2019-12-27 00:41:44
tar打包一个目录,想要排除掉某个文件夹,可以使用--exlude,不过 位置不要放到最后 目录结构 run run/test run/test/test.txt 想打包run成run.tar.gz 排除掉test目录 使用tar -czf run.tar.gz run --exclude 报错 使用tar --exclude -czf run.tar.gz run 来源: https://www.cnblogs.com/luckygxf/p/12105235.html

Tar changes relative symlinks to absolute symlinks

梦想的初衷 提交于 2019-12-25 18:41:32
问题 To simplify the sysroot generation for cross compiling, I generate a tar file with relative symbolic links. If I print the tar context with tar tvf sysroot-libc6-dev.tar then I get the correct result: lrw-r--r-- jens/jens 1 2018-03-30 23:42 usr/lib/x86_64-linux-gnu/libBrokenLocale.so -> ../../../lib/x86_64-linux-gnu/libBrokenLocale.so.1 lrw-r--r-- jens/jens 1 2018-03-30 23:42 usr/lib/x86_64-linux-gnu/libanl.so -> ../../../lib/x86_64-linux-gnu/libanl.so.1 lrw-r--r-- jens/jens 1 2018-03-30 23

Tar changes relative symlinks to absolute symlinks

倾然丶 夕夏残阳落幕 提交于 2019-12-25 18:41:23
问题 To simplify the sysroot generation for cross compiling, I generate a tar file with relative symbolic links. If I print the tar context with tar tvf sysroot-libc6-dev.tar then I get the correct result: lrw-r--r-- jens/jens 1 2018-03-30 23:42 usr/lib/x86_64-linux-gnu/libBrokenLocale.so -> ../../../lib/x86_64-linux-gnu/libBrokenLocale.so.1 lrw-r--r-- jens/jens 1 2018-03-30 23:42 usr/lib/x86_64-linux-gnu/libanl.so -> ../../../lib/x86_64-linux-gnu/libanl.so.1 lrw-r--r-- jens/jens 1 2018-03-30 23

linux下使用tar命令

此生再无相见时 提交于 2019-12-25 18:20:22
解压 语法:tar [主选项+辅选项] 文件或者目录 使用该命令时,主选项是必须要有的,它告诉tar要做什么事情,辅选项是辅助使用的,可以选用。 主选项: c 创建新的档案文件。如果用户想备份一个目录或是一些文件,就要选择这个选项。相当于打包。 x 从档案文件中释放文件。相当于拆包。 t 列出档案文件的内容,查看已经备份了哪些文件。 特别注意,在参数的下达中, c/x/t 仅能存在一个!不可同时存在!因为不可能同时压缩与解压缩。 辅助选项: -z :是否同时具有 gzip 的属性?亦即是否需要用 gzip 压缩或解压? 一般格式为xx.tar.gz或xx. tgz -j :是否同时具有 bzip2 的属性?亦即是否需要用 bzip2 压缩或解压?一般格式为xx.tar.bz2 -v :压缩的过程中显示文件!这个常用 -f :使用档名,请留意,在 f 之后要立即接档名喔!不要再加其他参数! -p :使用原文件的原来属性(属性不会依据使用者而变) --exclude FILE:在压缩的过程中,不要将 FILE 打包! 范例: 范例一:将整个 /etc 目录下的文件全部打包成为 /tmp/etc.tar [root@linux ~]# tar -cvf /tmp/etc.tar /etc    <==仅打包,不压缩! [root@linux ~]# tar -zcvf /tmp/etc

create and read tar.bz2 files in perl

梦想的初衷 提交于 2019-12-25 05:23:33
问题 I have been trying to use system("tar -jcvf archive_name.tar.bz2 $my_file") but I get an error archive_name.tar.bz2: Cannot open: No such file or directory tar: Error is not recoverable: exiting now tar: Child returned status 2 Is it not possible to create .tar.bz2 using this method in perl? I would prefer not to use a module but will if it is absolutely necessary 回答1: First of all, you're not doing it in Perl . You're spawning a separate process that runs the command. If you want to do this

create and read tar.bz2 files in perl

随声附和 提交于 2019-12-25 05:23:10
问题 I have been trying to use system("tar -jcvf archive_name.tar.bz2 $my_file") but I get an error archive_name.tar.bz2: Cannot open: No such file or directory tar: Error is not recoverable: exiting now tar: Child returned status 2 Is it not possible to create .tar.bz2 using this method in perl? I would prefer not to use a module but will if it is absolutely necessary 回答1: First of all, you're not doing it in Perl . You're spawning a separate process that runs the command. If you want to do this

how to make cygwin tar output proper unicode letters instead of shashed values?

拟墨画扇 提交于 2019-12-25 03:43:37
问题 I have a *.tar.gz file that have inside occasionally some names with non ascii letters. for example when tar encounter a file containing word: naïve it outputs: na\303\257ve Is there any swich, or tool to convert these slashed values to a proper letter ? 回答1: http://www.gnu.org/software/tar/manual/tar.html By default GNU tar attempts to unquote each file or member name, replacing escape sequences according to the following table: ... This default behavior is controlled by the following

Linux常用命令全集

杀马特。学长 韩版系。学妹 提交于 2019-12-25 01:12:27
Linux常用命令大全 最近都在和Linux打交道,感觉还不错。我觉得Linux相比windows比较麻烦的就是很多东西都要用命令来控制,当然,这也是很多人喜欢linux的原因,比较短小但却功能强大。我将我了解到的命令列举一下,仅供大家参考: 系统信息 arch 显示机器的处理器架构 uname -m 显示机器的处理器架构 uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda 罗列一个磁盘的架构特性 hdparm -tT /dev/sda 在磁盘上执行测试性读取操作 cat /proc/cpuinfo 显示CPU info的信息 cat /proc/interrupts 显示中断 cat /proc/meminfo 校验内存使用 cat /proc/swaps 显示哪些swap被使用 cat /proc/version 显示内核的版本 cat /proc/net/dev 显示网络适配器及统计 cat /proc/mounts 显示已加载的文件系统 lspci -tv 罗列 PCI 设备 lsusb -tv 显示 USB 设备 date 显示系统日期 cal 2007 显示2007年的日历表 date 041217002007.00 设置日期和时间 - 月日时分年.秒 clock

Using wget and cron to download webpages

邮差的信 提交于 2019-12-25 00:43:01
问题 Ok, so I know i can use: wget -r <website> > <file> to get a webpage and save it. My question is, how would i use cron and wget to get a webpage on an hourly, or even minute basis, and then save them into a folder, zip and tarball it, and then keep adding to it for a review at a later date. I know i can manually do this, my goal is to basically download it ever 10- 20 minutes, for roughly 4 hours (doesn't matter if it goes longer) and append the all into a nice directory, then zip said

Ubuntu解压缩zip,tar,tar.gz,tar.bz2

我是研究僧i 提交于 2019-12-24 22:33:23
ZIP zip可能是目前使用得最多的文档压缩格式。它最大的优点就是在不同的操作系统平台,比如Linux, Windows以及Mac OS,上使用。缺点就是支持的压缩率不是很高,而tar.gz和tar.gz2在压缩率方面做得非常好。闲话少说,我们步入正题吧: 我们可以使用下列的命令压缩一个目录: # zip -r archive_name.zip directory_to_compress 下面是如果解压一个zip文档: # unzip archive_name.zip TAR Tar是在Linux中使用得非常广泛的文档打包格式。它的好处就是它只消耗非常少的CPU以及时间去打包文件,他仅仅只是一个打包工具,并不负责压缩。下面是如何打包一个目录: # tar -cvf archive_name.tar directory_to_compress 如何解包: # tar -xvf archive_name.tar.gz 上面这个解包命令将会将文档解开在当前目录下面。当然,你也可以用这个命令来捏住解包的路径: # tar -xvf archive_name.tar -C /tmp/extract_here/ TAR.GZ 这种格式是我使用得最多的压缩格式。它在压缩时不会占用太多CPU的,而且可以得到一个非常理想的压缩率。使用下面这种格式去压缩一个目录: # tar -zcvf