<?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>wp &#124; anoopdotnet &#187; rm</title>
	<atom:link href="http://wp.anoop.net/tag/rm/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.anoop.net</link>
	<description>yet another meaningless wordpress blog</description>
	<lastBuildDate>Fri, 26 Mar 2010 03:51:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Handy mkdir, rm, ls commands with {}</title>
		<link>http://wp.anoop.net/2009/10/handy-mkdir-rm-ls-commands-with/</link>
		<comments>http://wp.anoop.net/2009/10/handy-mkdir-rm-ls-commands-with/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 00:37:24 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
				<category><![CDATA[Geekdom]]></category>
		<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[mkdir]]></category>
		<category><![CDATA[rm]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://wp.anoop.net/?p=183</guid>
		<description><![CDATA[I always find these commands handy when working with apache. Part of any VirtualHost config involves making the right directories and you can make your job easier by using curly braces. I suppose you could call it regular expressions. I don&#8217;t actually know the technical terms for it. I know it works in bash which [...]]]></description>
			<content:encoded><![CDATA[<p>I always find these commands handy when working with <a href="http://httpd.apache.org/" target="_blank">apache</a>.</p>
<p>Part of any <a href="http://httpd.apache.org/docs/2.0/vhosts/examples.html" target="_blank">VirtualHost</a> config involves making the right directories and you can make your job easier by using curly braces. I suppose you could call it regular expressions. I don&#8217;t actually know the technical terms for it. I know it works in bash which is what I use on a daily basis.</p>
<p>Learn how to create directories without having to issue multiple mkdir commands. This is a pretty simple one.</p>
<blockquote><p>mkdir -p /path/to/some/vhost/docs</p></blockquote>
<p>This is fairly straight forward. Make the parent directories if they don&#8217;t exist. So if <strong>/path/to/some/vhost/docs</strong> is what you want, and <strong>/path</strong> or any of it&#8217;s children don&#8217;t exist, then it will get created. It&#8217;s a fairly safe command because it intelligently checks before creating directories.</p>
<p>This example is a bit more complicated but it&#8217;s awesomeness will blow you away. I used this when I was making virtualhosts for multiple domains or even sub domains of the same parent.</p>
<blockquote><p>mkdir -p {sub1,sub2,sub3}.domain.com/{docs,logs,cgi-bin}</p>
<p>or</p>
<p>mkdir -p www.{domain1,domain2,domain3}.com/{docs,logs,cgi-bin}</p></blockquote>
<p>that command will create all your directories in the appropriate hierarchy so that you don&#8217;t need to issue multiple mkdir commands. It will create the parent directories for you as well. Here is what it does.</p>
<blockquote><p>$ find .<br />
.<br />
./www.domain1.com<br />
./www.domain1.com/cgi-bin<br />
./www.domain1.com/docs<br />
./www.domain1.com/logs<br />
./www.domain2.com<br />
./www.domain2.com/cgi-bin<br />
./www.domain2.com/docs<br />
./www.domain2.com/logs<br />
./www.domain3.com<br />
./www.domain3.com/cgi-bin<br />
./www.domain3.com/docs<br />
./www.domain3.com/logs</p></blockquote>
<p>You can also do that with ls.</p>
<blockquote><p>$ ls -d www.domain{1,2}*<br />
www.domain1.com    www.domain2.com</p></blockquote>
<p>Or even with rm</p>
<blockquote><p>$ rm -vr www.domain{1,3}*<br />
www.domain1.com/cgi-bin<br />
www.domain1.com/docs<br />
www.domain1.com/logs<br />
www.domain1.com<br />
www.domain3.com/cgi-bin<br />
www.domain3.com/docs<br />
www.domain3.com/logs<br />
www.domain3.com</p></blockquote>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://wp.anoop.net/2009/10/handy-mkdir-rm-ls-commands-with/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
