[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] How one can do untar a file and gzip its files with one co
From: |
Sergey Poznyakoff |
Subject: |
Re: [Bug-tar] How one can do untar a file and gzip its files with one command line? |
Date: |
Wed, 06 Apr 2016 07:46:21 +0300 |
Hi Ehsan,
A minor point, to begin with:
> tarfile=file.tar.gz
[...]
> tar cvf "$tarfile" "$file1" "$file2"
Since your file ends in .gz, you probably meant this:
tar cvfz "$tarfile" "$file1" "$file2"
> I want to untar the original file (i.e. file.tzr.gz) and directly gzip
> the untar files (i.e. file1.fastq and file2.fastq) with one command
Ok, here it is:
tar -vxf file.tar.gz --to-command 'gzip -c > $TAR_FILENAME.gz'
See the following link for details:
http://www.gnu.org/software/tar/manual/html_section/tar_34.html#SEC85
Regards,
Sergey