<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Screenage &#187; Netcat</title>
	<atom:link href="http://www.screenage.de/blog/category/netcat/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.screenage.de/blog</link>
	<description></description>
	<lastBuildDate>Sun, 13 Nov 2011 10:33:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using netcat and tar for network file transfer</title>
		<link>http://www.screenage.de/blog/2007/12/30/using-netcat-and-tar-for-network-file-transfer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-netcat-and-tar-for-network-file-transfer</link>
		<comments>http://www.screenage.de/blog/2007/12/30/using-netcat-and-tar-for-network-file-transfer/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 07:18:40 +0000</pubDate>
		<dc:creator>ccm</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[CommandLine]]></category>
		<category><![CDATA[FileTransfer]]></category>
		<category><![CDATA[Netcat]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Tar]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.screenage.de/blog/2007/12/30/using-netcat-and-tar-for-network-file-transfer/</guid>
		<description><![CDATA[Imagine you are on lan party or on the road and quickly want to transfer a file or directory to another computer. Both computer owners are just to lazy to setup something like ftp, smb, nfs. A very simple and &#8230; <a href="http://www.screenage.de/blog/2007/12/30/using-netcat-and-tar-for-network-file-transfer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Imagine you are on lan party or on the road and quickly want to transfer a file or directory to another computer. Both computer owners are just to lazy to setup something like ftp, smb, nfs. A very simple and even cross platform solution is using netcat and in case of a directory in combination with tar like the following steps. I will just show you how to use it without compression for a directory. Fell free to play around. You can test it locally of course.</p>
<p>1. The sender</p>
<p>The sender has to call netcat in server mode and pipe content into it. The next line tells tar to build a tarball and write it to standard output which is redirected via a pipe to netcat. Netcat is told to start in server mode (-l), listen on port 7878 (-p 7878) and shutdown itself after waiting 10 seconds after having seen an end of file in standard input (-q 10):</p>
<p><code>$ tar c directory | nc -q 10 -l -p 7878</code></p>
<p>2. The receiver</p>
<p>The receiver has to call netcat and tell him to <span id="more-13"></span>connect to the remote machine and the correct port and redirects the standard output to a file. For convenience he also sets a timeout parameter (-w 10):</p>
<p><code>$ nc -w 10 remotehost 7878 &gt; nameoftar.tar</code></p>
<p>That&#8217;s all. You just setup a very fast file transfer. For testing purposes use localhost. Please note that on the receiver side you are completely free to choose a file name for the .tar file. If you use something like gzip or bzip2 compression you should choose something like .tar.gz or .tar.bz2 of course.</p>
<p>Thanks to mnemonik pointing this out.</p>
<p>Feel free to add your file transfer quick hack here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.screenage.de/blog/2007/12/30/using-netcat-and-tar-for-network-file-transfer/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

