<?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>Javamancy &#187; UNIX</title>
	<atom:link href="http://www.javamancy.com/blog/tag/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javamancy.com/blog</link>
	<description>Where babbling isn&#039;t just merely babbling... it&#039;s flowing through the Internet, one transaction at a time...</description>
	<lastBuildDate>Wed, 11 Jan 2012 20:43:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to Iteratively Delete .svn Directories: A Better Way</title>
		<link>http://www.javamancy.com/blog/2009/09/24/how-to-iteratively-delete-svn-directories-a-better-way/</link>
		<comments>http://www.javamancy.com/blog/2009/09/24/how-to-iteratively-delete-svn-directories-a-better-way/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 14:37:58 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Meanderings]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Adam Bien]]></category>
		<category><![CDATA[configuration management]]></category>
		<category><![CDATA[Javamancy]]></category>
		<category><![CDATA[Javamancy mini]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.javamancy.com/blog/?p=2590</guid>
		<description><![CDATA[By now, gentle readers, you have probably seen the Javamancy mini post about the one-liner deletion for .svn files. I really like Adam Bien. He seems like a nice guy, and I occasionally drop by his blog, on a lark, to read his stuff, which is often focused on Java and NetBeans, one of our [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img class="size-full wp-image-2597 alignleft" title="SVN_dir_position_9-24-2009" src="http://www.javamancy.com/blog/wp-content/uploads/2009/09/SVN_dir_position_9-24-2009.png" alt="SVN_dir_position_9-24-2009" width="69" height="100" /></p>
<p>By now, gentle readers, you have probably seen the <em><a href="http://www.javamancy.com/mini/2009/09/24/how-to-iteratively-delete-svn-directories-the-debate/">Javamancy mini</a></em><a href="http://www.javamancy.com/mini/2009/09/24/how-to-iteratively-delete-svn-directories-the-debate/"> post about the one-liner deletion for <code>.svn</code> files</a>.</p>
<p>I really like <a href="http://www.adam-bien.com/" target="_blank">Adam Bien</a>. He seems like a nice guy, and I occasionally drop by his blog, on a lark, to read his stuff, which is often focused on Java and <a href="http://www.javamancy.com/blog/?s=NetBeans">NetBeans</a>, one of our favorite IDE&#8217;s that we use regularly for DevPal and <em><a href="http://www.javamancy.com/blog/">Javamancy</a></em> dev work, especially for Java and PHP. Now, I have never met him personally (which is unfortunate, since the inevitable Formidable Brain-Pick would come out, and I&#8217;d be picking his brain with it furiously (figuratively, &#8216;natch)), nor have I observed his programming, CM, and shell skills in action.</p>
<p>So I thought it was curious that he posted about <a href="http://www.adam-bien.com/roller/abien/entry/how_to_remove_all_svn" target="_blank">how to delete all .svn files with a &#8220;one-liner&#8221;</a>. Being a collector of snazzy UNIX scripting that make my life easier, I just had to look&#8230;<br />
<span id="more-2590"></span></p>
<h3>The Debated Script</h3>
<p>Now, keep in mind that Adam mentions that he found the one-liner elsewhere, but he liked it enough to post it. <img src='http://www.javamancy.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Here is what he suggests as the one-liner:</p>
<pre>find . -name ".svn" -exec rm -rf {} \;</pre>
<p>And this would be fine, under normal circumstances, if you are considering a relatively small population of <code>.svn</code> files that you want to remove and you do not care if somebody mistakenly named something on the filesystem as &#8220;<code>.svn</code>&#8221; despite it not being a Subversion directory.</p>
<p>But if you are like me, <em>and/or</em> you have at least one of several different CM structures that you support within one or more different versioning systems, and/or you have both people and automata that frequently access and modify those CM structures, you are most likely going to have thousands, <em>tens of thousands</em>, <em><strong>hundreds of thousands</strong></em>, or perhaps <strong><em><span style="text-decoration: underline;">millions</span></em></strong> of <code>.svn</code> directories that you have to account for. And you may have noticed that when you feed a large parameterized file list to the <code>rm</code> command directly causes it to choke after only a few hundred (or in some cases, several thousands, depending on your OS) entries.</p>
<h3>What DevPal Does</h3>
<p>So here&#8217;s an excerpt from one of my scripts that leverages the <code>xargs</code> utility to spoon-feed the <code>rm</code> command with smaller digestible chunks from the potentially huge file list that the <code>find</code> command readily retrieves:</p>
<pre>find . -type d -name .svn | xargs rm -rfv</pre>
<p>Like Adam&#8217;s snippet, I want to use the current directory position, but if you want to parameterize that to some other location (i.e., other than &#8220;.&#8221;), you certainly could.</p>
<p>Also, note that I&#8217;m only interested in directory names&#8230; I am not interested in non-directories that match &#8220;<code>.svn</code>&#8220;. This may or may not be the behavior you are supporting, so you may want to change the filetype specifier (say, to &#8220;<strong>f</strong>&#8220;) or drop it altogether.</p>
<p>Now, for the <code>rm</code> command switches: I tend to like to see what is going on during the deletion process, so in addition to inducing recursion through directories and forcing deletion without confirmation, I also want a bit of on-screen verbosity to show me what is being deleted. In this way, if I want to log the behavior, I can certainly redirect the output to a file or to a remote service. <img src='http://www.javamancy.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Anybody Hudson&#8217;ing, or just Ant&#8217;ing or Maven&#8217;ing with this? <img src='http://www.javamancy.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h3>Script or Not?</h3>
<p>Technically, while Adam offered up the one-liner as just that&#8230; a one-liner&#8230; I would guess that many of you have wondered about whether it makes more sense to wrap a script around it and give it a snazzy name. My recommendation is, of course, <em><strong>yes</strong></em>.</p>
<h3>N.B.</h3>
<div id="attachment_2600" class="wp-caption aligncenter" style="width: 195px">
	<img class="size-full wp-image-2600 " title="SVN_dir_level_position_9-24-2009" src="http://www.javamancy.com/blog/wp-content/uploads/2009/09/SVN_dir_level_position_9-24-2009.png" alt="SVN_dir_level_position_9-24-2009" width="195" height="92" />
	<p class="wp-caption-text">.svn as a directory</p>
</div>
<p>You may have noticed that there seems to be an interchangeable use of &#8220;files&#8221; and &#8220;directories&#8221; when referring to the <code>.svn</code> content. Which is correct? Both, actually, and it depends on your approach or perspective.</p>
<div id="attachment_2601" class="wp-caption aligncenter" style="width: 204px">
	<img class="size-full wp-image-2601 " title="SVN_contents_9-24-2009" src="http://www.javamancy.com/blog/wp-content/uploads/2009/09/SVN_contents_9-24-2009.png" alt="SVN_contents_9-24-2009" width="204" height="120" />
	<p class="wp-caption-text">Contents of the .svn directory</p>
</div>
<p>Whenever you browse your local directories within your sandbox, you will see that the <code>.svn</code> entries are actually directories. But if you peek into those directories, you will notice that there appears to be a set naming scheme to the files in there&#8230; as if they are arranged in a certain way to allow something (like a local database engine or parser ( <img src='http://www.javamancy.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  )) to efficiently access and modify the metadata for the versioned content. So, when referring to the <code>.svn</code> structure and contents, the UNIX<em>-y</em> notion of directories being also <em>files</em> can be more-inclusive.</p>
<p>By the way, this notion is also applicable for other versioning systems, including CVS (Subversion&#8217;s forebear).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javamancy.com/blog/2009/09/24/how-to-iteratively-delete-svn-directories-a-better-way/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac Cost Effectiveness</title>
		<link>http://www.javamancy.com/blog/2008/07/08/mac-cost-effectiveness/</link>
		<comments>http://www.javamancy.com/blog/2008/07/08/mac-cost-effectiveness/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 00:54:36 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Gadgetry]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.javamancy.com/blog/?p=69</guid>
		<description><![CDATA[Preface Folks, this is one of those historical tales of wonder (or, alternatively, extreme boredom) that I bring out whenever somebody has one of those funny ah-ha stories they bring to my attention. In the Beginning Way back in the primordial days of modern computing, I programmed on an Apple. Not a Mac, but an [...]]]></description>
			<content:encoded><![CDATA[<p></p><h3>Preface</h3>
<p>Folks, this is one of those historical tales of wonder (or, alternatively, extreme boredom) that I bring out whenever somebody has one of those funny <em>ah-ha</em> stories they bring to my attention.</p>
<h3>In the Beginning</h3>
<p>Way back in the primordial days of modern computing, I programmed on an Apple.</p>
<p>Not a Mac, but an Apple ][, when it came out... so, yeah, now you know how long I've been at this schtick. <img src='http://www.javamancy.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' />  Actually, before that, the concept of a CRT monitor to view code was quite outlandishly intriguing, since I'd been mucking around with the Altair for a couple of years. (Ugh! So now you really know how long I've been at this!)</p>
<p>In those days-- waxing somewhat nostalgic now-- there weren't many choices for workstations, so when you got something that worked, you stuck with it. Until something better and, especially, cheaper came along so you didn't have to wait for hours when you could wait for several minutes to wrap something up.</p>
<p>Instead of spending $100K's for a gigantic power-sucking mainframe, you could get a somewhat cutesy personal microcomputer for merely a few $1K's. That's where the Apple ][ enters the picture.</p>
<p>Eventually, IBM arrived on the scene with upgraded designs using the 808x series, and at that point, my newer Apple ][+ and Micromodem ][ weren't quite as performant, so I made the (difficult) break from the Apple camp. Hey, it's that cost thingy. (Oh, yeah, there's that teeny-tiny issue of <em>bulletin board systems</em> that had grabbed the attention of the pros, semi-pros, and hobbyists at this point in the late 1970&#8242;s&#8230; but that&#8217;s a very long, involved epic best left for later&#8230;)</p>
<p>Oh, and there&#8217;s that biz of all of the nifty peripherals being spewed forth for the IBM PC and PCjr, and then the PC clones. Lots &#8216;n lots of fun for days and days&#8230; plenty of assembler and BASIC and even C code to churn out!</p>
<h3>Fast Forwarding</h3>
<p>A few decades later, a funny thing happened: PCs weren&#8217;t so cheap any longer, and technological advancement had stagnated. Sure, there was a lot of activity in the mid-range and high-end server markets, where *NIX dominated and where hardware manufacturers wanted to play in the space using Windows 2000 Server (and later, 2003 Server) and commodity and proprietary-packaged Linux&#8217;es. Even IBM morphed its mainframe biz to virtualize Linux slices.</p>
<p>At this point, Apple had languished for years as a marginalized niche player in the pricey, kitschy slow-running desktop market. But then, a little snowflake of an opportunity occurred that began its journey into an avalanche of value and competitive advantage: the new line of aluminum PowerBooks and the mac mini.</p>
<p>The aluminum PowerBook G4 models were initially available with 12&#8243; and 17&#8243; diagonal screens. Although the designs were significantly more stylish and advanced than any other comparable PC notebooks, the pricing was extremely aggressive, placing them in direct competition with similar 12&#8243;-14&#8243; notebooks and 15&#8243; notebooks, respectively. While neither of these models (soon to be joined by a 15&#8243; model) were the lightest specimens for their classes, they were the thinnest of their type and had decent battery life, in addition to sporting decent networking support and hard disk capacities. With the G4 processors, they were not necessarily the most performant of notebooks, but over time that particular aspect would change&#8230;</p>
<p>&#8230; And then there was the mac mini, a blatant attempt to attract &#8220;low cost&#8221; consumers. The &#8220;low cost&#8221; aspect reflects a relative term, since some analysts reported that the pricing for the mac mini was still higher than that of bargain basement PC&#8217;s, although these individuals did not factor in the value being provided by the included software with the OS X operating system, particularly the iLife suite and the various UNIX utilities and command line access. For dramatically less than $800 USD (and less than $500 USD if you&#8217;re really price-savvy), a curious PC hacker would be able to get a decent functioning Mac that would be able to showcase the features of both a UNIX host and a Mac in a tiny form factor that clearly surpasses even the Shuttle PC&#8217;s of the time.</p>
<p>So, I splurged a little bit to get the 1.42 GHz G4 mac mini with the 80 GB hard disk. It <em>did</em> take me a couple of days to really get comfortable with the UI, but when I found the Terminal, I went absolutely nuts, fetching my favorite Java and UNIX code down onto the mac mini so I could accessorize it. Earlier, I had been looking at building a Shuttle PC type of machine to place in a somewhat space-limited location to use, and a notebook replacement for an ailing Dell Inspiron. The mac mini was my superior drop-in substitute for the Shuttle PC, and I didn&#8217;t have long to wait for the unveiling of the 12&#8243; PowerBook G4 a scant few months after the mac mini release.</p>
<p>When I got the PowerBook, I replaced the removable 256 MB RAM with a 1 GB module; with the additional memory, I found myself with the smallest notebook at work that also had more computing power than most of the workstations in my dev teams. Wowzers! And with the same UNIX and Java tools that I used on Solaris, HP-UX, and Linux boxes available to me, it became so easy to adapt my workflow to the PowerBook, which in turn made it convenient to develop, test, and document on the road.</p>
<p>But the biggest transformation in recent years came a couple of years afterward: the transition from PowerPC to Intel architectures. To maintain the competitive edge, Apple has become bound to Intel&#8217;s development roadmap; however, given Apple&#8217;s cachet, certain custom and early-release batches of Intel products have surreptitiously appeared in new Apple products. Go figure. <img src='http://www.javamancy.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The revamped iMac desktop line, as well as the newly positioned MacBook and professional MacBook Pro lines, benefited from the Intel Core Duo (and later, the Core 2 Duo) processors. And, to top things off big-time, the professional Mac Pro workstations gained the server-grade Xeon processors.</p>
<h3>And Now&#8230;</h3>
<p>Fast forward a couple more years to now, and we see a continuation of the inroads that Apple made with its new products.</p>
<p>Apple began a seemingly aggressive development campaign to become more relevant to creative professionals and consumers-at-large hungry for some innovation in their computers. Placed in the context of the ever-increasing market share of the iPod media devices, the halo effect from the iPods enabled spillover into the Mac line of products.</p>
<p>For the past several years, I&#8217;ve noticed that Macs continue to maintain a safe margin of cost effectiveness compared to similarly-equipped and accessorized Windows boxes. The most recent revelation came with the January 2008 release of the updated Mac Pro with the two 2.8 GHz Xeon Quad Core processors standard; while this &#8220;basic&#8221; Mac Pro arrives at about $2,500 USD, a similar Dell workstation costs at least $4,000 USD, and anyway, there were no comparable high-powered PC workstations at the time that the Mac Pro was released.</p>
<p>At this point, I&#8217;m not the only person to have realized there&#8217;s something quite interesting about the value vs. features comparisons between Macs and Windows PC&#8217;s. For example:</p>
<ul>
<li><a href="http://www.popularmechanics.com/technology/reviews/4258725.html" target="_blank">Popular Mechanics article</a></li>
<li><a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&amp;taxonomyName=macintosh_os&amp;articleId=9023959&amp;taxonomyId=123&amp;intsrc=kc_feat" target="_blank">ComputerWorld article</a></li>
<li><a href="http://machinist.salon.com/feature/2007/11/07/mac_price/index.html" target="_blank">Machinist/Salon article</a></li>
<li><a href="http://www.consumersearch.com/www/computers/apple-laptops/mac-vs-pc.html" target="_blank">ConsumerSearch article</a> (lots more info than just comparison opinions)</li>
</ul>
<h3>The Punch Line</h3>
<p>At this point, the people I&#8217;m telling the story to are either falling asleep or getting up for another coffee. So, I demurely lean back in my seat, sip my coffee a few times, and go back to blogging and browsing. <img src='http://www.javamancy.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.javamancy.com/blog/2008/07/08/mac-cost-effectiveness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

