<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Tar and compress a file in one step</title>
	<atom:link href="http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Sun, 22 Nov 2009 03:12:08 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Vinayak Kamath</title>
		<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/comment-page-1/#comment-16069</link>
		<dc:creator>Vinayak Kamath</dc:creator>
		<pubDate>Wed, 04 Nov 2009 02:21:43 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-16069</guid>
		<description>You can use gtar instead&lt;br&gt;&lt;br&gt;gtar -cvzf target output.tgz</description>
		<content:encoded><![CDATA[<p>You can use gtar instead</p>
<p>gtar -cvzf target output.tgz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fusiondog</title>
		<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/comment-page-1/#comment-14336</link>
		<dc:creator>fusiondog</dc:creator>
		<pubDate>Mon, 17 Aug 2009 20:20:09 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-14336</guid>
		<description>Or &#039;tar zcf target.tgz&#039;  Most tar versions have had built in gzip function for over a decade at least.  Over ssh it would be ssh blah@blah &#039;tar zcf -&#039; &gt; target.tgz</description>
		<content:encoded><![CDATA[<p>Or &#39;tar zcf target.tgz&#39;  Most tar versions have had built in gzip function for over a decade at least.  Over ssh it would be ssh blah@blah &#39;tar zcf -&#39; &gt; target.tgz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kraken</title>
		<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/comment-page-1/#comment-14319</link>
		<dc:creator>Kraken</dc:creator>
		<pubDate>Mon, 17 Aug 2009 06:36:56 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-14319</guid>
		<description>Instead one can also use&lt;br&gt;&lt;br&gt;tar -zcvf /home/abc/mydata.tgz /usr/somefolder</description>
		<content:encoded><![CDATA[<p>Instead one can also use</p>
<p>tar -zcvf /home/abc/mydata.tgz /usr/somefolder</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quinn McHenry</title>
		<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/comment-page-1/#comment-9347</link>
		<dc:creator>Quinn McHenry</dc:creator>
		<pubDate>Wed, 11 Mar 2009 19:11:34 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-9347</guid>
		<description>it would be:&lt;br&gt;&lt;br&gt;tar -cf - /home/eaips/var/fileName &#124; gzip -c &gt; /home/eaips/var/fileName.tar.gz</description>
		<content:encoded><![CDATA[<p>it would be:</p>
<p>tar -cf &#8211; /home/eaips/var/fileName | gzip -c &gt; /home/eaips/var/fileName.tar.gz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Satish</title>
		<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/comment-page-1/#comment-9342</link>
		<dc:creator>Satish</dc:creator>
		<pubDate>Wed, 11 Mar 2009 16:40:21 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-9342</guid>
		<description>I have following two steps in my script, how club them and do it in a single step ?&lt;br&gt;&lt;br&gt;tar  -cf  /home/eaips/var/fileName.tar  /home/eaips/var/fileName&lt;br&gt;gzip /home/eaips/var/fileName.tar</description>
		<content:encoded><![CDATA[<p>I have following two steps in my script, how club them and do it in a single step ?</p>
<p>tar  -cf  /home/eaips/var/fileName.tar  /home/eaips/var/fileName<br />gzip /home/eaips/var/fileName.tar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hseb72</title>
		<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/comment-page-1/#comment-841</link>
		<dc:creator>Hseb72</dc:creator>
		<pubDate>Thu, 14 Oct 2004 09:21:21 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-841</guid>
		<description>If  you wanna try something a little bit funnier, tar and zip a file, then unzip and untar it in another directory in only one step (this is usefull to keep symlinks unchanged)

tar -cvf - mySelection &#124; gzip -c  &#124; (cd myNewDirectory ; gzip -dc &#124; tar xvf -)

make this match to your own needs...</description>
		<content:encoded><![CDATA[<p>If  you wanna try something a little bit funnier, tar and zip a file, then unzip and untar it in another directory in only one step (this is usefull to keep symlinks unchanged)</p>
<p>tar -cvf &#8211; mySelection | gzip -c  | (cd myNewDirectory ; gzip -dc | tar xvf -)</p>
<p>make this match to your own needs&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bofh468</title>
		<link>http://www.tech-recipes.com/rx/64/tar-and-compress-a-file-in-one-step/comment-page-1/#comment-29</link>
		<dc:creator>bofh468</dc:creator>
		<pubDate>Thu, 13 Nov 2003 21:02:20 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-29</guid>
		<description>Although this probably belongs under the OpenSSH section, this is a really neat trick for snapping a tarball of a machine with limited diskspace, and storing the output on your workstation (or machine that your SSH&#039;ing from).

You must already have the hostkey from the remote machine (i.e., logged in at least once) otherwise this will fail.  SSH allows you to connect to a remote machine and pass a commandline rather than firing up an interactive shell.  The output is then dumped to your local console for further processing.

Before you scratch your head, think of this.  You have a machine that has virtually no space left (or at least, not enough to make that tarball).  qmchenry&#039;s post shows you how to get tar to spool the archive to stdout:

&lt;code&gt;
tar -cf - target
&lt;/code&gt;


What if you can capture that to your own workstation, which probably has ample space.   Picture this:

&lt;code&gt;
ssh user@remotemachine &quot;cd /path;tar -cf - target &#124; gzip -c&quot; &gt; /path/target.tgz
&lt;/code&gt;


You&#039;ve just had the remote machine produce a tarball, run it through gzip,  and dump the results to stdout.  You just captured that at your own workstation, and saved the results.</description>
		<content:encoded><![CDATA[<p>Although this probably belongs under the OpenSSH section, this is a really neat trick for snapping a tarball of a machine with limited diskspace, and storing the output on your workstation (or machine that your SSH&#8217;ing from).</p>
<p>You must already have the hostkey from the remote machine (i.e., logged in at least once) otherwise this will fail.  SSH allows you to connect to a remote machine and pass a commandline rather than firing up an interactive shell.  The output is then dumped to your local console for further processing.</p>
<p>Before you scratch your head, think of this.  You have a machine that has virtually no space left (or at least, not enough to make that tarball).  qmchenry&#8217;s post shows you how to get tar to spool the archive to stdout:</p>
<p><code><br />
tar -cf - target<br />
</code></p>
<p>What if you can capture that to your own workstation, which probably has ample space.   Picture this:</p>
<p><code><br />
ssh user@remotemachine &quot;cd /path;tar -cf - target | gzip -c&quot; &gt; /path/target.tgz<br />
</code></p>
<p>You&#8217;ve just had the remote machine produce a tarball, run it through gzip,  and dump the results to stdout.  You just captured that at your own workstation, and saved the results.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
