<div class="gmail_quote">2011/8/31 xinyou yan <span dir="ltr"><<a href="mailto:yxy.716@gmail.com">yxy.716@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
HI:<br>
<br>
How can i use use gzip to compress and tar to append the other file:<br>
<br>
here is is a testcase :<br>
<br>
<br>
file :test1 test2<br>
<br>
:~/testtar # tar -czf 1.tar.gz test1<br>
:~/testtar # tar -rzf 1.tar.gz test2<br>
</blockquote><div><br></div><div>Could you use tar czf 1.tar.gz test1 test2 ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">tar: Cannot update compressed archives<br>
Try `tar --help' or `tar --usage' for more information.<br>
<br>
However tar -cf<br>
tar -rf can work fine.<br>
<br>
I am thinking find a way useing gzip to compress and tar then and<br>
need to append any time .<br>
<br>
Thank you<br>
<br>
<br>
<br>
2011/8/31 j.e.aneiros <<a href="mailto:jesus.aneiros@gmail.com">jesus.aneiros@gmail.com</a>>:<br>
> Hi,<br>
> gzip is a compressor, not an archiver as tar. zip is an archiver and<br>
> compressor. So maybe you could use tar with the z option to compress?<br>
><br>
> Best regards, --janeiros.<br>
> On Tue, Aug 30, 2011 at 12:57 PM, xinyou yan <<a href="mailto:yxy.716@gmail.com">yxy.716@gmail.com</a>> wrote:<br>
>><br>
>> Hi every one ,<br>
>><br>
>> I was confuse to use gzip in shell.<br>
>> You see below. I can use zip -gj make test.tar include the<br>
>> testfile and the test1file<br>
>> However , use gzip make the test_gzip.tar.gz NULL.<br>
>> I see man and use gzip -c file >> tarname. to add a file to a tar file<br>
>> .<br>
>> Can anyone tell me why?<br>
>> You can let /root have two sample file testfile test1file<br>
>><br>
>><br>
>> #!/bin/sh<br>
>><br>
>> anse='/root/test.tar'<br>
>> anse_gzip='/root/test_gzip.tar.gz'<br>
>> test='/usr/local/sbin/testfile'<br>
>> test1='/usr/local/sbin/test1file'<br>
>><br>
>> zip -gj $anse $test<br>
>> zip -gj $anse $test1<br>
>><br>
>> gzip -c $test >> $anse_gzip<br>
>> gzip -c $test1 >> $anse_gzip<br>
>><br>
>> I think gzip can do what zip can do in linux .<br>
>><br>
>> If I just do<br>
>> gzip -c testfile >> test_gzip.tar.gz<br>
>><br>
>> It can create the test_gzip.tar.gz file But can't include any file .<br>
>><br>
>><br>
>><br>
>> --<br>
>> ----------------------------------------------------------------<br>
>> 嘉谟之行<br>
>> "昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"<br>
>> ----------------------------------------------------------------<br>
>> --<br>
>> users mailing list<br>
>> <a href="mailto:users@lists.fedoraproject.org">users@lists.fedoraproject.org</a><br>
>> To unsubscribe or change subscription options:<br>
>> <a href="https://admin.fedoraproject.org/mailman/listinfo/users" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/users</a><br>
>> Guidelines: <a href="http://fedoraproject.org/wiki/Mailing_list_guidelines" target="_blank">http://fedoraproject.org/wiki/Mailing_list_guidelines</a><br>
><br>
><br>
><br>
> --<br>
> J. E. Aneiros<br>
> GNU/Linux User #190716 en <a href="http://counter.li.org" target="_blank">http://counter.li.org</a><br>
> perl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'<br>
> PK fingerprint: 5179 917E 5B34 F073 E11A AFB3 4CB3 5301 4A80 F674<br>
><br>
> --<br>
> users mailing list<br>
> <a href="mailto:users@lists.fedoraproject.org">users@lists.fedoraproject.org</a><br>
> To unsubscribe or change subscription options:<br>
> <a href="https://admin.fedoraproject.org/mailman/listinfo/users" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/users</a><br>
> Guidelines: <a href="http://fedoraproject.org/wiki/Mailing_list_guidelines" target="_blank">http://fedoraproject.org/wiki/Mailing_list_guidelines</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
----------------------------------------------------------------<br>
嘉谟之行<br>
"昔我往矣,杨柳依依 ; 今我来思 ,雨雪霏霏"<br>
----------------------------------------------------------------<br>
<font color="#888888">--<br>
users mailing list<br>
<a href="mailto:users@lists.fedoraproject.org">users@lists.fedoraproject.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/users" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/users</a><br>
Guidelines: <a href="http://fedoraproject.org/wiki/Mailing_list_guidelines" target="_blank">http://fedoraproject.org/wiki/Mailing_list_guidelines</a><br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>J. E. Aneiros</div><div>GNU/Linux User #190716 en <a href="http://counter.li.org" target="_blank">http://counter.li.org</a></div><div>perl -e '$_=pack(c5,0105,0107,0123,0132,(1<<3)+2);y[A-Z][N-ZA-M];print;'</div>
<div>PK fingerprint: 5179 917E 5B34 F073 E11A AFB3 4CB3 5301 4A80 F674</div><br>