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