I am not sure how to use -l. But here is the test case. The -n option
does not seem to be effective. Otherwise, there should be no time in
the .gz file. But there still is.

Could anybody let me know what is the correct command is? Thanks.

$ cat main.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:

tmpdir=$(mktemp -d)
mkdir -p "$tmpdir"/dir
touch "$tmpdir"/dir/input1.txt
touch "$tmpdir"/dir/input2.txt
tar czvfl "$tmpdir"/file.tar.gz -C "$tmpdir" dir
set -v
file "$tmpdir"/file.tar.gz

$ ./main.sh
dir/
dir/input1.txt
dir/input2.txt
file "$tmpdir"/file.tar.gz
/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/tmp.YGOcGLwrKR/file.tar.gz:
gzip compressed data, from Unix, last modified: Wed Dec  6 15:41:06
2017

On Wed, Dec 6, 2017 at 11:13 AM, Ralph Corderoy <ra...@inputplus.co.uk> wrote:
> Hi Peng,
>
>> GZIP=-n tar czf name.tar.gz name
>
> The -I option might help; give it gzip and its -n option.
>
> --
> Cheers, Ralph.
> https://plus.google.com/+RalphCorderoy



-- 
Regards,
Peng

Reply via email to