
<?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>Examancer &#187; linux</title>
	<atom:link href="http://examancer.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://examancer.com</link>
	<description>take in moderation</description>
	<lastBuildDate>Fri, 16 Dec 2011 00:15:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Advanced &#8216;grep&#8217;: Search for Multiple Strings Simultaneously</title>
		<link>http://examancer.com/2010/12/advanced-grep-search-for-multiple-strings-simultaneously/</link>
		<comments>http://examancer.com/2010/12/advanced-grep-search-for-multiple-strings-simultaneously/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 22:28:16 +0000</pubDate>
		<dc:creator>Carl Zulauf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://examancer.com/?p=178</guid>
		<description><![CDATA[It took me a while to figure out how to do this so I thought I&#8217;d post a quick guide for other people who might need to have this trick up their sleeve. The unix/linux grep command can use POSIX extended regular expressions. I learned from this guide that unlike most other regular expression implementations [...]]]></description>
			<content:encoded><![CDATA[<p>It took me a while to figure out how to do this so I thought I&#8217;d post a quick guide for other people who might need to have this trick up their sleeve.</p>
<p>The unix/linux <a href="http://en.wikipedia.org/wiki/Grep">grep</a> command can use <a href="http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions">POSIX extended regular expressions</a>. I learned from <a href="http://www.regular-expressions.info/posix.html#bre">this guide</a> that unlike most other regular expression implementations the meta-characters must be escaped to be treated as meta-characters. If they are not escaped grep will treat them as literal characters. This is exactly opposite of most regular expression engines where you escape meta-characters when you <strong>don&#8217;t</strong> want them treated by the regex engine as special characters.</p>
<p>I&#8217;m not particularly great at regex and I didn&#8217;t find a lot of guides on using extended POSIX regular expressions with grep. This really surprised me.</p>
<p>In my scenario I had a really large file I needed to search through. I had several unique strings I thought might be in this file and due to its size I didn&#8217;t want to execute a separate grep command for each string. This would be woefully inefficient as the entire file would be searched independently for each string. This approach would also take much much longer to complete and would be a lot more work for me.</p>
<p>Instead, I knew there had to be a way to craft a single command that would search the file once looking for any lines containing any of the strings I supplied. Well, using my mediocre knowledge of regular expressions and my new-found understanding of the behavior of grep&#8217;s regex engine I came up with the following command:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-nE</span> \<span style="color: #7a0874; font-weight: bold;">&#40;</span>string1\<span style="color: #000000; font-weight: bold;">|</span>string2\<span style="color: #000000; font-weight: bold;">|</span>string3\<span style="color: #000000; font-weight: bold;">|</span>string4\<span style="color: #7a0874; font-weight: bold;">&#41;</span> theFile.txt</div></div>
<p>Breaking down the command further:</p>
<ul>
<li><strong>grep</strong> &#8211; Indicates we are using the unix/linux grep utility.</li>
<li><strong>-nE</strong> &#8211; These are the grep &#8220;options.&#8221; &#8216;n&#8217; tells grep to tell us which line number any matches came from when it spits out its results. &#8216;E&#8217; tells grep to use its extended regular expression engine (required for this kind of search).</li>
<li><strong>\(</strong> and <strong>\)</strong> &#8211; These are the &#8220;range&#8221; boundaries for the regular expression. Technically not required here, but I find it good practice to use ranges in case you ever need to back reference. Grep would treat these like any other string if they weren&#8217;t escaped with the backslash. We want grep to treat these as special regex characters (range boundaries in this case) so we must escape them.</li>
<li><strong>\|</strong> &#8211; The regex &#8220;OR&#8221; operator. This tells grep that it can match either the value to the left or the value to the right of this operator. If you read out the statement above as &#8220;or&#8221; the command makes perfect sense. We are telling grep: find string1 OR string2 OR string3 OR string4 in theFile.txt. Since we want this to be treated by grep as an OR operator and not just another character it also needs to be escaped with a backslash.</li>
<li><strong>string1</strong>, <strong>string2</strong>, <strong>string3</strong>, and <strong>string4</strong> &#8211; The strings grep should be looking for in the file. The line &#8220;I like the taste of string1&#8242;s bread&#8221; would match string1 and would be in the results outputted by grep. The line &#8220;I think String2 has a really mean demeanor&#8221; would not match since this search is case sensitive by default.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://examancer.com/2010/12/advanced-grep-search-for-multiple-strings-simultaneously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printing a Specific Line From a Large File in Linux</title>
		<link>http://examancer.com/2009/12/printing-a-specific-line-from-a-large-file-in-linux/</link>
		<comments>http://examancer.com/2009/12/printing-a-specific-line-from-a-large-file-in-linux/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 17:24:35 +0000</pubDate>
		<dc:creator>Carl Zulauf</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://examancer.com/?p=164</guid>
		<description><![CDATA[I recently had to find a specific line in a large (28GB) file equipped with nothing more than the line number. I thought it would take me just a few seconds to find a cool *nix utility to accomplish this task. Instead, it took me a bit of scouring to find something that works, and [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to find a specific line in a large (28GB) file equipped with nothing more than the line number. I thought it would take me just a few seconds to find a cool *nix utility to accomplish this task. Instead, it took me a bit of scouring to find something that works, and works well on large files. That&#8217;s OK though since I had to wait for the 28GB file to uncompress from a tarball&#8230; which, obviously, takes a while.</p>
<p>What I learned about while I waited was the *nix command &#8216;sed&#8217;. This is a tool built for command line processing of data files. Apparently it was birthed as an evolution of our trusty friend &#8216;grep&#8217;. The forum post I found which hinted that &#8216;sed&#8217; was my solution didn&#8217;t provide much real information and the <a href="http://en.wikipedia.org/wiki/Sed">Wikipedia article</a> was mostly background and provided examples that won&#8217;t help me.</p>
<p>Where I found the most useful info was the <a href="http://sed.sourceforge.net/">sed page on sourceforge</a>&#8230; go figure. The docs page pointed me to &#8216;<a href="http://sed.sourceforge.net/sed1line.txt">The sed one-liners</a>&#8216; by Eric Pement. Here I found, through example, the power of &#8216;sed&#8217; and an example that is more efficient on large files than the ones I found elsewhere.</p>
<p>So here is how you do it:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'34005050q;d'</span> filename</div></div>
<p>&#8217;34005050&#8242; is the line number. &#8216;q&#8217; tells sed you are looking for that line number, and &#8216;;d&#8217; tells it to stop after that line. &#8216;filename&#8217; is of course the file you are trying to coax a specific line out of. To do an inclusive range of lines all at once (lines 8 through 12, for example), do this:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'8,12!d'</span> filename</div></div>
<p>I&#8217;m still learning about &#8216;sed&#8217; but its already saving my ass. Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://examancer.com/2009/12/printing-a-specific-line-from-a-large-file-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Quick Inventory and Review of Alternative Gnome Web Browsers for a Netbook</title>
		<link>http://examancer.com/2009/02/a-quick-inventory-and-review-of-alternative-gnome-web-browsers-for-a-netbook/</link>
		<comments>http://examancer.com/2009/02/a-quick-inventory-and-review-of-alternative-gnome-web-browsers-for-a-netbook/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 17:17:46 +0000</pubDate>
		<dc:creator>Carl Zulauf</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[acer]]></category>
		<category><![CDATA[AspireOne]]></category>
		<category><![CDATA[epiphany]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[galeon]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[midori]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://examancer.com/?p=116</guid>
		<description><![CDATA[Firefox performance in linux is always a bit lacking, so I thought I&#8217;d try some of the many alternative web browsers for Ubuntu (Gnome). All of these were tested on an Acer AspireOne running Ubuntu 8.10 and all were installed through the Ubuntu package repositories. Midori A small and simple WebKit browser. I have been [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox performance in linux is always a bit lacking, so I thought I&#8217;d try some of the many alternative web browsers for Ubuntu (Gnome). All of these were tested on an Acer AspireOne running Ubuntu 8.10 and all were installed through the Ubuntu package repositories.</p>
<p><strong>Midori</strong></p>
<p>A small and simple WebKit browser. I have been looking for a good WebKit browser to use in linux&#8230; unfortunately this isn&#8217;t it. The performance is pretty decent when loading and using the page itself, but the actual program UI is clunky, slow, and buggy. This one needs some serious GTK+ work before it can expect to be a real choice for Ubuntu users. It hasn&#8217;t crashed on me or anything, but the fact that the toolbar can get resized if you switch tabs or use the back/forward buttons <strong>should not happen</strong>, but it does and it happens <strong>slowly.</strong></p>
<p><strong>Epiphany</strong></p>
<p>Uses the Gecko layout engine, like Firefox, and seems to do it a little slower than Firefox. Some of the tab behaviors are odd and difficult to configure. When I click on a link that should open in a new window I generally don&#8217;t want it to appear in a new <em>window</em>, I want it in a new <em>tab</em>. Back and forward history seem to be shared among tabs in the same window? I guess I could see how that would be useful, but it is very odd behavior. Double clicking in the empty area of the tab bar doesn&#8217;t spawn a new tab? Also odd. All-in-all this isn&#8217;t a bad browser, it just doesn&#8217;t seem to do <strong>anything</strong> better than Firefox, which I was really hoping for.</p>
<p><strong>Galeon</strong></p>
<p>This is another browser using the Gecko layout engine. This browser actually feels pretty fast. I have enjoyed using it. However, it is not without issues. On a netbook it is very frustrating that I cannot seem to configure the browser&#8217;s UI to take up a minimal amount of screen space. The stock back and forward buttons are huge, and the height of the toolbar they are on is way to large. Even in full screen, the UI takes up too much vertical screen real estate.</p>
<p>These are the only alternative browsers I have tried so far. None of these browsers offer a good alternative to Firefox on a screen-space-constrained netbook. Not a single browser here had a windowed or full screen mode that offered as much screen real-estate dedicated to displaying the web page as Firefox (when properly configured). Even after exploring the various configuration options there appears to be no way to make ANY of these browsers use less or even similar amounts of screen-space for their UI compared to Firefox (not counting the options to remove the toolbar entirely, which is not realistic) . On a screen this small page real-estate becomes very important. There should at least be OPTIONS to make the UI as minimal as possible, but the options provided are simply inadequate. This compounds the fact that Midori and Epiphany both feel slower than Firefox. Galeon, which generally feels as fast or faster than Firefox, is crippled for me by the fact that the minimum usable UI configuration is the largest of the group. Also, not a single one of these browsers offers the ability have a FULL full-screen browser, like Firefox, where the UI auto-hides and the web page is given nearly 100% of the screen. I hope with the growing number of netbook users and the growing number of them running linux this will have to be a form factor each brower&#8217;s community will develop for and offer more customizable/minimizable user interfaces.</p>
]]></content:encoded>
			<wfw:commentRss>http://examancer.com/2009/02/a-quick-inventory-and-review-of-alternative-gnome-web-browsers-for-a-netbook/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Supercomputers: US Embracing &#8220;The People&#8217;s&#8221; Operating System While China Goes Commercial</title>
		<link>http://examancer.com/2008/12/supercomputers-us-embracing-the-peoples-operating-system-while-china-goes-commercial/</link>
		<comments>http://examancer.com/2008/12/supercomputers-us-embracing-the-peoples-operating-system-while-china-goes-commercial/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 21:12:44 +0000</pubDate>
		<dc:creator>Carl Zulauf</dc:creator>
				<category><![CDATA[News and Opinion]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[HPC]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[top500]]></category>
		<category><![CDATA[united states]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://examancer.com/?p=93</guid>
		<description><![CDATA[I was glancing through the November 2008 TOP500 list of the world&#8217;s most powerful super computing sites, and noticed a few interesting details. First I noticed that the US increased its dominance at the top of the list. The nine fastest super computing sites are all in the United States. You must go all the [...]]]></description>
			<content:encoded><![CDATA[<p>I was glancing through the <a href="http://www.top500.org/lists/2008/11/press-release">November 2008</a> <a href="http://www.top500.org/">TOP500</a> list of the world&#8217;s most powerful super computing sites, and noticed a few interesting details.</p>
<p>First I noticed that the US increased its dominance at the top of the list. The nine fastest super computing sites are all in the United States. You must go all the way to the tenth fastest to find a computing site outside of the United States. In the previous list (June 2008) the US still dominated, but Germany, France, and India all had computing sites in the top ten. With just six of ten fastest computing sites located in the US only six months ago, the nine out of ten score this time around is a significant improvement. The TOP500 list has been published twice a year since 1993 and looking through all the previous lists this is the most dominant the US has ever been in the top ten, and possibly overall.</p>
<p>The second interesting thing I noticed was that the tenth place site is located in China. This is only China&#8217;s second time being listed in the top ten (the last time was in <a href="http://www.top500.org/list/2004/06/100">June 2004</a>), and they have yet to reach any higher on the list than tenth place.</p>
<p>However, what really caught my eye was the choice of operating systems in the top ten systems. All nine of the systems located in the US are using some flavor of Linux as their operating system. Linux is built by a community of volunteer programmers around the world and is often considered antithetical to commercial software. By association, some people believe Linux and the Open Source software movement are in direct opposition to capitalism. I found it both ironic and gratifying to see that the most commercial and capitalistic nation on earth is dominating the rankings of the world&#8217;s fastest computing sites using a product assumed to be at odds with both commercialism and capitalism. In an even more ironic twist of fate, The People&#8217;s Repulbic of China, whose communist leaders often insist on home grown solutions for many industries, are using a foreign commercial software stack to run their fastest computing site: Microsoft Windows HPC 2008.</p>
<p>Beyond being interesting, does this list offer any real economic, scientific, or political insight? Probably not. However, if it did, it appears the list would be saying that the United States is not loosing its relevance as the center of the information technology revolution as quickly as many have suggested. It might also be telling us that the United States is embracing &#8220;socialist&#8221;, &#8220;grassroots&#8221;, or &#8220;community&#8221; tools (when it comes to software) to a greater degree than many realize, and that China may be embracing capitalism and commercialism more quickly than we are often led to believe.</p>
]]></content:encoded>
			<wfw:commentRss>http://examancer.com/2008/12/supercomputers-us-embracing-the-peoples-operating-system-while-china-goes-commercial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

