tar

opening a .tar.gz file with a single command

二次信任 提交于 2019-12-09 04:27:54
问题 when I download a .tar.gz file, I open it with two commands, first gunzip and then tar . Is it possible to open it with just one command? 回答1: tar xzf file.tar.gz The letters are: x - extract z - gunzip the input f - Read from a file, not stdin 回答2: You can use tar with a "z" argument tar xvfz mytar.tar.gz 回答3: If you don't have gnu tar it is still possible to open the file in a single step (although technically still two commands) using a pipe zcat file.tar.gz |tar x 回答4: How do I extract a

Tar: create archive exclude directories except one

柔情痞子 提交于 2019-12-08 15:11:19
问题 I have some directories with some files dir_archive/somedir1 dir_archive/somedir2 dir_archive/somedir3 dir_archive/mydir dir_archive/mydir/excludedir1 dir_archive/mydir/excludedir2 dir_archive/mydir/excludedir3 dir_archive/mydir/many_other_directories... dir_archive/mydir/my_archive_dir I want create tar(gz) archive dir_archive.tar.gz with all files and directories exclude dir_archive/mydir/excludedir1 dir_archive/mydir/excludedir2 dir_archive/mydir/excludedir3 dir_archive/mydir/many_other

Exclude common subdirectories when creating a tarball

我与影子孤独终老i 提交于 2019-12-08 15:07:19
问题 I'm creating a tarball of a large codebase managed in ClearCase. Every directory has a sub-directory named ".CC". I'd like to exclude these from my tarball. I've found Excluding directory when creating a .tar.gz file, but excluding that would appear to require passing each and every .CC directory on the commndline. This is impractical in my case. Is there a way to exclude directories that meet a particular pattern? EDIT: I am not asking how to exclude a specific finite list of directories. I

Windows command line tar “cannot connect to d: resolve failed” with Chef Knife

ε祈祈猫儿з 提交于 2019-12-08 14:55:49
问题 Using Windows Command line with cygwin, chef and ruby installed. When trying knife cookbook site install mysql returns the following error Begin output of tar zxvf D:/path/to/chef-repo/cookbooks/mysql.tar.gz STDOUT: STDERR: tar<child>: Cannot connect to D: resolve failed gzip: stdin: undexpected end of file tar: Child returned status 128 tar: Error is not recoverable: exiting now</code> How can I remedy this issue? I can manually unzip using tar zxvf mysql.tar.gz but this is less than ideal.

Extract file using bash script

ぃ、小莉子 提交于 2019-12-08 14:15:31
问题 I created a script which will extract all *.tar.gz file. This file is decompressed five times .tar.gz file, but the problem is that only the first *.tar.gz file is being extracted. for file in *.tar.gz; do gunzip -c "$file" | tar xf - done rm -vf "$file" What should I do this? Answers are greatly appreciated. 回答1: If your problem is that the tar.gz file contains another tar.gz file which should be extracted as well, you need a different sort of loop. The wildcard at the top of the for loop is

AndroidStudio运行出错解决 JVM target 1.8 into bytecode that is being built with JVM target 1.6

房东的猫 提交于 2019-12-08 14:00:14
AndroidStudio运行报错 Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6 再所出错的module里的build.gradle里加入 tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { jvmTarget = "1.8" } } 这样就可以了。 来源: CSDN 作者: sweet_smile5 链接: https://blog.csdn.net/sweet_smile5/article/details/98858919

Recursively listing the contents of a tar/zip archive

谁都会走 提交于 2019-12-08 12:44:01
问题 I understand how to get contents of zip/tar files, for example: http://www.if-not-true-then-false.com/2010/list-tar-tar-gz-tar-bz2-contents/ But in my case: I want to get all contents of a zip archive. ABCD.zip -->somefile.txt -->somezip.zip -->someother.tar OBJECTIVE: I want to get contents of ABCD.zip so that I also get what is further inside somezip.zip and someother.tar, and someother.tar may also have some other zips etc. How can I do that with recursion? Possibly with a bash/perl script

Unix script to find all folders in the directory, then tar and move them

女生的网名这么多〃 提交于 2019-12-08 07:02:54
问题 Basically I need to run a Unix script to find all folders in the directory /fss/fin, if it exists; then I have tar it and move to another directory /fs/fi. This is my command so far: find /fss/fin -type d -name "essbase" -print Here I have directly mentioned the folder name essbase . But instead, I would like to find all the folders in the /fss/fin and use them all. How do I find all folders in the /fss/fin directory & tar them to move them to /fs/fi ? Clarification 1: Yes I need to find only

Tar problem with apache commons compress

余生颓废 提交于 2019-12-08 06:02:07
问题 I'm having a hard time trying to tar some files using the compress library. My code is the following, and is taken from the commons.compress wiki exemples : private static File createTarFile(String[] filePaths, String saveAs) throws Exception{ File tarFile = new File(saveAs); OutputStream out = new FileOutputStream(tarFile); TarArchiveOutputStream aos = (TarArchiveOutputStream) new ArchiveStreamFactory().createArchiveOutputStream("tar", out); for(String filePath : filePaths){ File file = new

Linux常用命令大全归类

南笙酒味 提交于 2019-12-08 03:53:27
系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) 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 -w 将时间修改保存到 BIOS 文件和目录 cd /home 进入 '/ home' 目录' cd .. 返回上一级目录 cd ../.. 返回上两级目录 cd 进入个人的主目录 cd ~user1 进入个人的主目录 cd -