<?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>Smartkey - Java Software Consultancy &#187; Unix / Linux</title>
	<atom:link href="http://blog.smartkey.co.uk/tag/unix-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartkey.co.uk</link>
	<description></description>
	<lastBuildDate>Tue, 13 Dec 2011 15:03:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Unix Command to Recursively Delete all .svn Folders</title>
		<link>http://blog.smartkey.co.uk/2009/11/recursively-delete-svn-folders/</link>
		<comments>http://blog.smartkey.co.uk/2009/11/recursively-delete-svn-folders/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 11:26:39 +0000</pubDate>
		<dc:creator>Steve Neal</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tool support]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Unix / Linux]]></category>

		<guid isPermaLink="false">http://blog.smartkey.co.uk/?p=554</guid>
		<description><![CDATA[I recently needed to check out a project from Subversion and then delete all of the .svn files from the project directories. Google found me a few different ways to do this, but none of them seemed to deal with a case where some of the directory and file names had spaces or quotes in them – as mine did. After a little experimenting, I figured out how some simple Unix commands that could be combined using pipes to do this.]]></description>
			<content:encoded><![CDATA[<p>I recently needed to check out a project from Subversion and then delete all of the .svn files from the project directories. Google found me a few different ways to do this, but none of them seemed to deal with a case where some of the directory and file names had spaces or quotes in them &#8211; as mine did.</p>
<p>After a little experimenting, I figured out the following commands could be combined as illustrated below:</p>
<p>From within the project root folder this command can be used to list all of the .svn directories:</p>
<pre>$ find . -type d -name .svn</pre>
<p>If your directory names don&#8217;t have spaces or quotes in them, then you could just pipe the find command directly into xargs and rm to delete them all:</p>
<pre>$ find . -type d -name .svn | xargs rm -rf</pre>
<p>If you do have spaces or quotes in your directory names, then you need to change the newlines returned from find into null characters (notice the -print0 flag), and make xargs use this to split the input into individual file names (see the -0 flag) rather than the newlines, spaces and quotes that it normally looks for:</p>
<pre>$ find . -type d -name .svn -print0 | xargs -0 rm -fr</pre>
<p>The above command will delete all directories named &#8216;.svn&#8217;, regardless of whether they have spaces, or quote characters in their names.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartkey.co.uk/2009/11/recursively-delete-svn-folders/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

