<?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>Ruy Rocha &#187; Linux</title>
	<atom:link href="http://ruyrocha.com/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://ruyrocha.com</link>
	<description>it&#039;s a long way to the top if wanna rock and roll</description>
	<lastBuildDate>Tue, 31 Jan 2012 02:17:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>CentOS 5.6 &#8211; here we go :)</title>
		<link>http://ruyrocha.com/centos-5-6-here-we-go/</link>
		<comments>http://ruyrocha.com/centos-5-6-here-we-go/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 21:14:00 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 5.6]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=359</guid>
		<description><![CDATA[And please read known issues &#8211; http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.6#head-60758eb5ab66c94f98fda0383fa8c7a8b97b9c53 Tweet This Post Post to Delicious Digg This Post Post to Facebook Post to LinkedIn]]></description>
			<content:encoded><![CDATA[<p>And please read known issues &#8211; <a title="CentOS 5.6 - Known Issues" href="http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.6#head-60758eb5ab66c94f98fda0383fa8c7a8b97b9c53">http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.6#head-60758eb5ab66c94f98fda0383fa8c7a8b97b9c53</a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=CentOS+5.6+%E2%80%93+here+we+go+%3A%29+http%3A%2F%2Fis.gd%2FD8j74j" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter CentOS 5.6   here we go :)"  title="CentOS 5.6   here we go :)" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=CentOS+5.6+%E2%80%93+here+we+go+%3A%29+http%3A%2F%2Fis.gd%2FD8j74j" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/centos-5-6-here-we-go/&amp;title=CentOS+5.6+%E2%80%93+here+we+go+%3A%29" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious CentOS 5.6   here we go :)"  title="CentOS 5.6   here we go :)" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/centos-5-6-here-we-go/&amp;title=CentOS+5.6+%E2%80%93+here+we+go+%3A%29" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/centos-5-6-here-we-go/&amp;title=CentOS+5.6+%E2%80%93+here+we+go+%3A%29" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg CentOS 5.6   here we go :)"  title="CentOS 5.6   here we go :)" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/centos-5-6-here-we-go/&amp;title=CentOS+5.6+%E2%80%93+here+we+go+%3A%29" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/centos-5-6-here-we-go/&amp;t=CentOS+5.6+%E2%80%93+here+we+go+%3A%29" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook CentOS 5.6   here we go :)"  title="CentOS 5.6   here we go :)" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/centos-5-6-here-we-go/&amp;t=CentOS+5.6+%E2%80%93+here+we+go+%3A%29" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/centos-5-6-here-we-go/&amp;title=CentOS+5.6+%E2%80%93+here+we+go+%3A%29&amp;summary=And+please+read+known+issues+-+http%3A%2F%2Fwiki.centos.org%2FManuals%2FReleaseNotes%2FCentOS5.6%23head-60758eb5ab66c94f98fda0383fa8c7a8b97b9c53&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin CentOS 5.6   here we go :)"  title="CentOS 5.6   here we go :)" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/centos-5-6-here-we-go/&amp;title=CentOS+5.6+%E2%80%93+here+we+go+%3A%29&amp;summary=And+please+read+known+issues+-+http%3A%2F%2Fwiki.centos.org%2FManuals%2FReleaseNotes%2FCentOS5.6%23head-60758eb5ab66c94f98fda0383fa8c7a8b97b9c53&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/centos-5-6-here-we-go/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/centos-5-6-here-we-go/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oi, htop</title>
		<link>http://ruyrocha.com/oi-htop/</link>
		<comments>http://ruyrocha.com/oi-htop/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 17:53:52 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[htop]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=269</guid>
		<description><![CDATA[515MB of awesomeness Proc: Intel Xeon E5520 Tweet This Post Post to Delicious Digg This Post Post to Facebook Post to LinkedIn]]></description>
			<content:encoded><![CDATA[<p><a href="http://ruyrocha.com/wp-content/uploads/2011/01/monster-ram.jpg"><img class="aligncenter size-full wp-image-270" title="monster-ram" src="http://ruyrocha.com/wp-content/uploads/2011/01/monster-ram.jpg" alt="monster ram Oi, htop" width="933" height="368" /></a>515MB of <strong>awesomeness</strong></p>
<p>Proc: Intel Xeon E5520 <img src='http://ruyrocha.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Oi, htop" class='wp-smiley' title="Oi, htop" /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Oi%2C+htop+http%3A%2F%2Fis.gd%2FpdD4ED" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter Oi, htop"  title="Oi, htop" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Oi%2C+htop+http%3A%2F%2Fis.gd%2FpdD4ED" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/oi-htop/&amp;title=Oi%2C+htop" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious Oi, htop"  title="Oi, htop" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/oi-htop/&amp;title=Oi%2C+htop" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/oi-htop/&amp;title=Oi%2C+htop" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg Oi, htop"  title="Oi, htop" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/oi-htop/&amp;title=Oi%2C+htop" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/oi-htop/&amp;t=Oi%2C+htop" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook Oi, htop"  title="Oi, htop" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/oi-htop/&amp;t=Oi%2C+htop" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/oi-htop/&amp;title=Oi%2C+htop&amp;summary=515MB+of+awesomeness%0D%0A%0D%0AProc%3A+Intel+Xeon+E5520+%3A%29&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin Oi, htop"  title="Oi, htop" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/oi-htop/&amp;title=Oi%2C+htop&amp;summary=515MB+of+awesomeness%0D%0A%0D%0AProc%3A+Intel+Xeon+E5520+%3A%29&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/oi-htop/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/oi-htop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx On CentOS made easy, yay!</title>
		<link>http://ruyrocha.com/nginx-on-centos-made-easy-yay/</link>
		<comments>http://ruyrocha.com/nginx-on-centos-made-easy-yay/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 03:53:49 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx on centos]]></category>
		<category><![CDATA[ngxin upstream fair]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=255</guid>
		<description><![CDATA[Please refer to these three gists: compile nginx on centos using passenger-install-nginx-module nginx&#8217;s init script &#8211; ripped from EPEL nginx.conf with gzip compression enhanced Please, note we&#8217;ve installed upstream-fair module. This module sends an incoming request to the least-busy backend server, rather than distributing requests round-robin. Tweet This Post Post to Delicious Digg This Post [...]]]></description>
			<content:encoded><![CDATA[<p>Please refer to these three gists:</p>
<ol>
<li><a title="install nginx on centos using passenger" href="https://gist.github.com/772318">compile nginx on centos using passenger-install-nginx-module</a></li>
<li><a title="nginx's init script" href="https://gist.github.com/772319">nginx&#8217;s init script</a> &#8211; ripped from EPEL</li>
<li><a title="nginx.conf - gzip enhanced" href="https://gist.github.com/772327">nginx.conf</a> with gzip compression enhanced</li>
</ol>
<p>Please, note we&#8217;ve installed <strong>upstream-fair</strong> module. This module <em>sends an incoming request to the least-busy backend server, rather than distributing requests round-robin</em>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Nginx+On+CentOS+made+easy%2C+yay%21+http%3A%2F%2Fis.gd%2FiMd72x" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter Nginx On CentOS made easy, yay!"  title="Nginx On CentOS made easy, yay!" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Nginx+On+CentOS+made+easy%2C+yay%21+http%3A%2F%2Fis.gd%2FiMd72x" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;title=Nginx+On+CentOS+made+easy%2C+yay%21" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious Nginx On CentOS made easy, yay!"  title="Nginx On CentOS made easy, yay!" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;title=Nginx+On+CentOS+made+easy%2C+yay%21" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;title=Nginx+On+CentOS+made+easy%2C+yay%21" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg Nginx On CentOS made easy, yay!"  title="Nginx On CentOS made easy, yay!" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;title=Nginx+On+CentOS+made+easy%2C+yay%21" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;t=Nginx+On+CentOS+made+easy%2C+yay%21" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook Nginx On CentOS made easy, yay!"  title="Nginx On CentOS made easy, yay!" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;t=Nginx+On+CentOS+made+easy%2C+yay%21" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;title=Nginx+On+CentOS+made+easy%2C+yay%21&amp;summary=Please+refer+to+these+three+gists%3A%0D%0A%0D%0A%09compile+nginx+on+centos+using+passenger-install-nginx-module%0D%0A%09nginx%27s+init+script+-+ripped+from+EPEL%0D%0A%09ngin...&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin Nginx On CentOS made easy, yay!"  title="Nginx On CentOS made easy, yay!" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/nginx-on-centos-made-easy-yay/&amp;title=Nginx+On+CentOS+made+easy%2C+yay%21&amp;summary=Please+refer+to+these+three+gists%3A%0D%0A%0D%0A%09compile+nginx+on+centos+using+passenger-install-nginx-module%0D%0A%09nginx%27s+init+script+-+ripped+from+EPEL%0D%0A%09ngin...&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/nginx-on-centos-made-easy-yay/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/nginx-on-centos-made-easy-yay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diehard Bash &#8211; Eliminando o &#8220;Não Fui Eu&#8221;</title>
		<link>http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/</link>
		<comments>http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 19:09:55 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bash_history]]></category>
		<category><![CDATA[chattr +a]]></category>
		<category><![CDATA[chattr +i]]></category>
		<category><![CDATA[diehard bash]]></category>
		<category><![CDATA[unset histfile]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=196</guid>
		<description><![CDATA[Vez por outra acontecem alguns problemas &#8211; que obviamente não deveriam acontecer. Mas acontecem, então, tudo bem. Antes mesmo de iniciar qualquer processo de auditoria você pode conversar com outras pessoas, e, acompanhado aos problemas, poderá receber o famoso não fui eu. Ao utilizar o bash, todos os comandos digitados são salvos no arquivo ~/.bash_history, [...]]]></description>
			<content:encoded><![CDATA[<p>Vez por outra acontecem alguns problemas &#8211; que obviamente não deveriam acontecer. Mas acontecem, então, tudo bem. Antes mesmo de iniciar qualquer processo de auditoria você pode conversar com outras pessoas, e, acompanhado aos problemas, poderá receber o famoso <strong>não fui eu</strong>.</p>
<p>Ao utilizar o <strong>bash</strong>, todos os comandos digitados são salvos no arquivo <span style="text-decoration: underline;">~/.bash_history</span>, por ser o arquivo carregado na variável de ambiente <strong>HISTFILE</strong>. Da mesma forma que esta variável está declarada, nós podemos não declará-la utilizando <em>unset</em>, como em</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># history | tail -n 5</span>
  <span style="color: #000000;">188</span>  <span style="color: #c20cb9; font-weight: bold;">chmod</span> 0600 .ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
  <span style="color: #000000;">189</span>  <span style="color: #7a0874; font-weight: bold;">history</span>
  <span style="color: #000000;">190</span>  <span style="color: #7a0874; font-weight: bold;">history</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-l</span>
  <span style="color: #000000;">191</span>  <span style="color: #7a0874; font-weight: bold;">history</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span>
  <span style="color: #000000;">192</span>  <span style="color: #7a0874; font-weight: bold;">history</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">5</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># unset HISTFILE</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># echo '' &amp;gt; z</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>A partir do echo todos os comandos não serão salvos no <strong>history</strong>, e ficarão perdidos em algum universo paralelo.</p>
<p>Ainda poderemos limpar o <strong>history</strong>, como em</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># history | wc -l</span>
<span style="color: #000000;">189</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># history -c</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;">#</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># history | wc -l</span>
<span style="color: #000000;">1</span></pre></div></div>

<p>Ou também deletar o arquivo que guarda o histórico, perdendo já completamente a noção:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rm -f .bash_history</span></pre></div></div>

<p>Na manha? <strong>Não</strong> quero perder o histórico. Não quero que limpem ou apaguem ele também. Bem, vamos lá!</p>
<p><span id="more-196"></span></p>
<p>O primeiro passo é colocar a variável HISTFILE em modo readonly, desta forma não sendo possível <em>unsetá-la</em>. Para isto, editaremos o arquivo informado a seguir e atribuiremos permissão de execução:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cat /etc/profile.d/bash_variables.sh</span>
<span style="color: #7a0874; font-weight: bold;">readonly</span> HISTFILE
<span style="color: #7a0874; font-weight: bold;">readonly</span> HISTFILESIZE
<span style="color: #7a0874; font-weight: bold;">readonly</span> HISTIGNORE
<span style="color: #7a0874; font-weight: bold;">readonly</span> HISTSIZE
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># chmod +x /etc/profile.d/bash_variables.sh</span></pre></div></div>

<p>Ao re-logar na máquin, receberemos este aviso ao tentar unsetar a variável:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># unset HISTFILE</span>
-bash: <span style="color: #7a0874; font-weight: bold;">unset</span>: HISTFILE: cannot <span style="color: #7a0874; font-weight: bold;">unset</span>: <span style="color: #7a0874; font-weight: bold;">readonly</span> variable</pre></div></div>

<p>Perfeito! Agora temos um começo. No entanto isto apenas coloca a variável em modo de leitura, e não previne que limpem ou removam o arquivo de histórico.</p>
<p>Para que não removam o arquivo, precisaremos mudar os atributos do arquivo, colocando-o em modo para só receber informações, e nada mais, como em</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># chattr +a .bash_history</span></pre></div></div>

<p>Não teremos sucesso se tentarmos apagar o arquivo:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rm -f .bash_history</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span>: cannot remove <span style="color: #000000; font-weight: bold;">`</span>.bash_history<span style="color: #ff0000;">': Operation not permitted</span></pre></div></div>

<p>É outro passo, mas não impede de limparmos o histórico ainda:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># history</span>
    <span style="color: #000000;">1</span>  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> .bash_history
    <span style="color: #000000;">2</span>  <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile<span style="color: #000000; font-weight: bold;">/</span>bash_variables.sh
    <span style="color: #000000;">3</span>  <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile.d<span style="color: #000000; font-weight: bold;">/</span>bash_variables.sh
    <span style="color: #000000;">4</span>  <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile.d<span style="color: #000000; font-weight: bold;">/</span>bash_variables.sh
    <span style="color: #000000;">5</span>  <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile.d<span style="color: #000000; font-weight: bold;">/</span>bash_variables.sh
    <span style="color: #000000;">6</span>  <span style="color: #7a0874; font-weight: bold;">unset</span> HISTFILE
    <span style="color: #000000;">7</span>  <span style="color: #c20cb9; font-weight: bold;">chattr</span> +a .bash_history
    <span style="color: #000000;">8</span>  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> .bash_history
    <span style="color: #000000;">9</span>  <span style="color: #7a0874; font-weight: bold;">history</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># history -c</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># history</span>
    <span style="color: #000000;">1</span>  <span style="color: #7a0874; font-weight: bold;">history</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>E agora? Precisamos de outro arquivo de history, contendo as reais informações. Para isto, iremos alterar a variável PROMPT_COMMAND, que será carregada no bash_profile local, informando um arquivo alternativo &#8211; o <strong>~/.real_bash_history</strong>. O arquivo ~/.bash_profile receberá a flag imutável, para não ser alterado:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># touch .real_bash_history</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># chattr +a .real_bash_history</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vim .bash_profile</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># chattr +i .bash_profile</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cat .bash_profile</span>
<span style="color: #666666; font-style: italic;"># .bash_profile</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Get the aliases and functions</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	. ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># User specific environment and startup programs</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROMPT_COMMAND</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${PROMPT_COMMAND:+$PROMPT_COMMAND ; }</span>&quot;</span><span style="color: #ff0000;">'echo $$ $USER &quot;$(history 1)&quot; &amp;gt;&amp;gt; ~/.real_bash_history'</span>
<span style="color: #7a0874; font-weight: bold;">readonly</span> PROMPT_COMMAND
&nbsp;
<span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> PATH
<span style="color: #7a0874; font-weight: bold;">unset</span> USERNAME</pre></div></div>

<p>Ao logar novamente na máquina, por mais que o arquivo de histórico seja limpo, as informações ficarão guardadas no real_bash_history, como em:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cat .real_bash_history</span>
<span style="color: #000000;">1951</span> root     <span style="color: #000000;">5</span>  <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile.d<span style="color: #000000; font-weight: bold;">/</span>bash_variables.sh
<span style="color: #000000;">1951</span> root     <span style="color: #000000;">6</span>  <span style="color: #7a0874; font-weight: bold;">history</span>
<span style="color: #000000;">1951</span> root     <span style="color: #000000;">7</span>  usnet HISTFILE
<span style="color: #000000;">1951</span> root     <span style="color: #000000;">8</span>  <span style="color: #7a0874; font-weight: bold;">unset</span> HISTFILE
<span style="color: #000000;">1951</span> root     <span style="color: #000000;">9</span>  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> .bash_history
<span style="color: #000000;">1951</span> root    <span style="color: #000000;">10</span>  <span style="color: #7a0874; font-weight: bold;">history</span>
<span style="color: #000000;">1951</span> root
<span style="color: #000000;">1951</span> root     <span style="color: #000000;">1</span>  <span style="color: #7a0874; font-weight: bold;">history</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>mx2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rm -rf .bash_profile</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span>: cannot remove <span style="color: #000000; font-weight: bold;">`</span>.bash_profile<span style="color: #ff0000;">': Operation not permitted
[root@mx2 ~]# rm -rf .real_bash_history
rm: cannot remove `.real_bash_history'</span>: Operation not permitted</pre></div></div>

<p>E agora, zézão?</p>
<p><img class="aligncenter size-full wp-image-204" title="troll_face01" src="http://ruyrocha.com/wp-content/uploads/2010/12/troll_face01.jpg" alt="troll face01 Diehard Bash   Eliminando o Não Fui Eu" width="206" height="251" /></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D+http%3A%2F%2Fis.gd%2FCrmDWz" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter Diehard Bash   Eliminando o Não Fui Eu"  title="Diehard Bash   Eliminando o Não Fui Eu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D+http%3A%2F%2Fis.gd%2FCrmDWz" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;title=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious Diehard Bash   Eliminando o Não Fui Eu"  title="Diehard Bash   Eliminando o Não Fui Eu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;title=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;title=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg Diehard Bash   Eliminando o Não Fui Eu"  title="Diehard Bash   Eliminando o Não Fui Eu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;title=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;t=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook Diehard Bash   Eliminando o Não Fui Eu"  title="Diehard Bash   Eliminando o Não Fui Eu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;t=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;title=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D&amp;summary=Vez+por+outra+acontecem+alguns+problemas+-+que+obviamente+n%C3%A3o+deveriam+acontecer.+Mas+acontecem%2C+ent%C3%A3o%2C+tudo+bem.+Antes+mesmo+de+iniciar+qualquer+p...&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin Diehard Bash   Eliminando o Não Fui Eu"  title="Diehard Bash   Eliminando o Não Fui Eu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/&amp;title=Diehard+Bash+%E2%80%93+Eliminando+o+%E2%80%9CN%C3%A3o+Fui+Eu%E2%80%9D&amp;summary=Vez+por+outra+acontecem+alguns+problemas+-+que+obviamente+n%C3%A3o+deveriam+acontecer.+Mas+acontecem%2C+ent%C3%A3o%2C+tudo+bem.+Antes+mesmo+de+iniciar+qualquer+p...&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/diehard-bash-eliminando-o-nao-fui-eu/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Dá uma balançada aí, vai! &#8211; Balanceamento simples com Pen</title>
		<link>http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/</link>
		<comments>http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 17:32:27 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[epel]]></category>
		<category><![CDATA[load balancer]]></category>
		<category><![CDATA[monit]]></category>
		<category><![CDATA[pen]]></category>
		<category><![CDATA[penctl]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=187</guid>
		<description><![CDATA[Load balancing com pen é tão simples quanto andar pra frente. Bem na manha. Depois do yum -y install pen (disponível no EPEL), basta um &#91;root@m ~&#93;# pen -l /var/log/pen.log -p /var/run/pen.pid -r 25001 x.x.x.x:25 y.y.y.y:25 w.w.w.w:25 z.z.z.z:25 E pronto! O suporte a arquivos de configuração (man penctl) ajuda bastante para iniciar. Guardar o pid [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em>Load balancing </em></strong>com pen é tão simples quanto <strong>andar pra frente</strong>. Bem na manha.</p>
<p>Depois do <em>yum -y install pen</em> (disponível no EPEL), basta um</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>m ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># pen -l /var/log/pen.log -p /var/run/pen.pid -r 25001 x.x.x.x:25 y.y.y.y:25 w.w.w.w:25 z.z.z.z:25</span></pre></div></div>

<p>E pronto! O suporte a arquivos de configuração (<em>man penctl</em>) ajuda bastante para iniciar. Guardar o pid do daemon pra verificar com o monit ajuda <strong>demais</strong> também.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen+http%3A%2F%2Fis.gd%2FCtCDb5" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter Dá uma balançada aí, vai!   Balanceamento simples com Pen"  title="Dá uma balançada aí, vai!   Balanceamento simples com Pen" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen+http%3A%2F%2Fis.gd%2FCtCDb5" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;title=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious Dá uma balançada aí, vai!   Balanceamento simples com Pen"  title="Dá uma balançada aí, vai!   Balanceamento simples com Pen" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;title=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;title=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg Dá uma balançada aí, vai!   Balanceamento simples com Pen"  title="Dá uma balançada aí, vai!   Balanceamento simples com Pen" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;title=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;t=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook Dá uma balançada aí, vai!   Balanceamento simples com Pen"  title="Dá uma balançada aí, vai!   Balanceamento simples com Pen" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;t=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;title=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen&amp;summary=Load+balancing+com+pen+%C3%A9+t%C3%A3o+simples+quanto+andar+pra+frente.+Bem+na+manha.%0D%0A%0D%0ADepois+do+yum+-y+install+pen+%28dispon%C3%ADvel+no+EPEL%29%2C+basta+um%0D%0A%5Broot%40m...&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin Dá uma balançada aí, vai!   Balanceamento simples com Pen"  title="Dá uma balançada aí, vai!   Balanceamento simples com Pen" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/&amp;title=D%C3%A1+uma+balan%C3%A7ada+a%C3%AD%2C+vai%21+%E2%80%93+Balanceamento+simples+com+Pen&amp;summary=Load+balancing+com+pen+%C3%A9+t%C3%A3o+simples+quanto+andar+pra+frente.+Bem+na+manha.%0D%0A%0D%0ADepois+do+yum+-y+install+pen+%28dispon%C3%ADvel+no+EPEL%29%2C+basta+um%0D%0A%5Broot%40m...&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/da-uma-balancada-ai-vai-balanceamento-simples-com-pen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalação Automatizada do Ubuntu</title>
		<link>http://ruyrocha.com/instalacao-automatizada-do-ubuntu/</link>
		<comments>http://ruyrocha.com/instalacao-automatizada-do-ubuntu/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 10:44:15 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[instalacao automatizada]]></category>
		<category><![CDATA[kickseed]]></category>
		<category><![CDATA[kickstart]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=104</guid>
		<description><![CDATA[É possível realizar instalações automatizadas do Ubuntu via kickstart com o kickseed. Bem melhor, né? Mais aqui. Tweet This Post Post to Delicious Digg This Post Post to Facebook Post to LinkedIn]]></description>
			<content:encoded><![CDATA[<p>É possível realizar instalações automatizadas do Ubuntu via kickstart com o <strong>kickseed</strong>. Bem melhor, né? <img src='http://ruyrocha.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Instalação Automatizada do Ubuntu" class='wp-smiley' title="Instalação Automatizada do Ubuntu" /> </p>
<p>Mais <a title="Automated Ubuntu Installation" href="http://ubuntu-tutorials.com/2007/10/14/automated-ubuntu-installation-preview/">aqui</a>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu+http%3A%2F%2Fis.gd%2FuYNYu5" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter Instalação Automatizada do Ubuntu"  title="Instalação Automatizada do Ubuntu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu+http%3A%2F%2Fis.gd%2FuYNYu5" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious Instalação Automatizada do Ubuntu"  title="Instalação Automatizada do Ubuntu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg Instalação Automatizada do Ubuntu"  title="Instalação Automatizada do Ubuntu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;t=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook Instalação Automatizada do Ubuntu"  title="Instalação Automatizada do Ubuntu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;t=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu&amp;summary=%C3%89+poss%C3%ADvel+realizar+instala%C3%A7%C3%B5es+automatizadas+do+Ubuntu+via+kickstart+com+o+kickseed.+Bem+melhor%2C+n%C3%A9%3F+%3A%29%0D%0A%0D%0AMais+aqui.&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin Instalação Automatizada do Ubuntu"  title="Instalação Automatizada do Ubuntu" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/instalacao-automatizada-do-ubuntu/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Ubuntu&amp;summary=%C3%89+poss%C3%ADvel+realizar+instala%C3%A7%C3%B5es+automatizadas+do+Ubuntu+via+kickstart+com+o+kickseed.+Bem+melhor%2C+n%C3%A9%3F+%3A%29%0D%0A%0D%0AMais+aqui.&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/instalacao-automatizada-do-ubuntu/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/instalacao-automatizada-do-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalação Automatizada do Debian</title>
		<link>http://ruyrocha.com/instalacao-automatizada-do-debian/</link>
		<comments>http://ruyrocha.com/instalacao-automatizada-do-debian/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 15:24:07 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian preseed]]></category>
		<category><![CDATA[instalacao automatizada]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=102</guid>
		<description><![CDATA[O único modo (duvidoso) de automatizar a instalação do Debian é usando preseed e aqui está a documentação. Numa boa? Sem o debconf-get-selections demoraria para escrever na unha o arquivo usado na instalação. Ah, Kickstart&#8230; Tweet This Post Post to Delicious Digg This Post Post to Facebook Post to LinkedIn]]></description>
			<content:encoded><![CDATA[<p>O único modo (duvidoso) de automatizar a instalação do Debian é <a title="Automating Debian Ubuntu Installs With Preseed" href="http://pthree.org/2008/05/20/automating-debianubuntu-installs-with-preseed/">usando preseed</a> e <a title="Automating the installation using preseeding" href="http://d-i.alioth.debian.org/manual/en.i386/apb.html">aqui</a> está a documentação.</p>
<p>Numa boa? Sem o <strong>debconf-get-selections</strong> demoraria para escrever na unha o arquivo usado na instalação.</p>
<p>Ah, Kickstart&#8230; <img src='http://ruyrocha.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Instalação Automatizada do Debian" class='wp-smiley' title="Instalação Automatizada do Debian" /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Instala%C3%A7%C3%A3o+Automatizada+do+Debian+http%3A%2F%2Fis.gd%2FYySlTX" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter Instalação Automatizada do Debian"  title="Instalação Automatizada do Debian" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Instala%C3%A7%C3%A3o+Automatizada+do+Debian+http%3A%2F%2Fis.gd%2FYySlTX" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Debian" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious Instalação Automatizada do Debian"  title="Instalação Automatizada do Debian" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Debian" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Debian" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg Instalação Automatizada do Debian"  title="Instalação Automatizada do Debian" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Debian" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;t=Instala%C3%A7%C3%A3o+Automatizada+do+Debian" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook Instalação Automatizada do Debian"  title="Instalação Automatizada do Debian" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;t=Instala%C3%A7%C3%A3o+Automatizada+do+Debian" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Debian&amp;summary=O+%C3%BAnico+modo+%28duvidoso%29+de+automatizar+a+instala%C3%A7%C3%A3o+do+Debian+%C3%A9+usando+preseed+e+aqui+est%C3%A1+a+documenta%C3%A7%C3%A3o.%0D%0A%0D%0ANuma+boa%3F+Sem+o+debconf-get-selection...&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin Instalação Automatizada do Debian"  title="Instalação Automatizada do Debian" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/instalacao-automatizada-do-debian/&amp;title=Instala%C3%A7%C3%A3o+Automatizada+do+Debian&amp;summary=O+%C3%BAnico+modo+%28duvidoso%29+de+automatizar+a+instala%C3%A7%C3%A3o+do+Debian+%C3%A9+usando+preseed+e+aqui+est%C3%A1+a+documenta%C3%A7%C3%A3o.%0D%0A%0D%0ANuma+boa%3F+Sem+o+debconf-get-selection...&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/instalacao-automatizada-do-debian/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/instalacao-automatizada-do-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comando find no Linux</title>
		<link>http://ruyrocha.com/linux-comandos-find/</link>
		<comments>http://ruyrocha.com/linux-comandos-find/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 20:35:30 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[comandos linux]]></category>
		<category><![CDATA[find -maxtype]]></category>
		<category><![CDATA[find -mintype]]></category>
		<category><![CDATA[man find]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=36</guid>
		<description><![CDATA[Inaugurando a nova seção (Comandos), com um breve post sobre como procurar arquivos no Linux. O find (man find) tem algumas coisas bem úteis. Por exemplo, você pode buscar por arquivos, por diretórios, por links simbólicos, pelo nome do arquivo sem diferenciar maiúsculas e minúsculas &#8211; lembrando que sistemas *NIX são case sensitive, etc. A [...]]]></description>
			<content:encoded><![CDATA[<p>Inaugurando a nova seção (Comandos), com um breve post sobre  como procurar arquivos no Linux.</p>
<p>O find (man find) tem algumas coisas bem úteis. Por exemplo, você pode buscar por arquivos, por diretórios, por links simbólicos, pelo nome do arquivo sem diferenciar maiúsculas e minúsculas &#8211; lembrando que sistemas *NIX são <em>case sensitive</em>, etc.<span id="more-36"></span></p>
<p>A sintaxe do find é:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> caminho expressao</pre></div></div>

<p>O caminho é onde você quer procurar, sendo relativo ou absoluto. Agora, com a expressão, podemos fazer as coisas legais. A expressão -type no diz de que tipo é o arquivos, veja:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> f
<span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> d
<span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> l</pre></div></div>

<p>Os três comandos acima buscariam, a partir do diretório em que você está, por arquivos, diretórios e links simbólicos, respectivamente.</p>
<p>Agora, para casar o tipo do arquivo com o nome, são usadas os parâmetros -name ou -iname (<em>ignore case</em>):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;nome&quot;</span> <span style="color: #660033;">-type</span> f
<span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">&quot;*nom?.backup&quot;</span> <span style="color: #660033;">-type</span> d</pre></div></div>

<p>E aquele asterisco? E a interrogação? É possível utilizar os metacaractéres do shell. Isto, os wildcards, os coringas. Os mesmos que você usaria num <em>ls</em> da vida.</p>
<p>Suponhamos que você tem a seguinte estrutura de diretórios:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>a<span style="color: #000000; font-weight: bold;">/</span>d1
.<span style="color: #000000; font-weight: bold;">/</span>a<span style="color: #000000; font-weight: bold;">/</span>d2
.<span style="color: #000000; font-weight: bold;">/</span>a<span style="color: #000000; font-weight: bold;">/</span>d3
.<span style="color: #000000; font-weight: bold;">/</span>b<span style="color: #000000; font-weight: bold;">/</span>d
.<span style="color: #000000; font-weight: bold;">/</span>c<span style="color: #000000; font-weight: bold;">/</span>d1
.<span style="color: #000000; font-weight: bold;">/</span>c<span style="color: #000000; font-weight: bold;">/</span>d2
.<span style="color: #000000; font-weight: bold;">/</span>c<span style="color: #000000; font-weight: bold;">/</span>d3
.<span style="color: #000000; font-weight: bold;">/</span>c<span style="color: #000000; font-weight: bold;">/</span>d4
.<span style="color: #000000; font-weight: bold;">/</span>d<span style="color: #000000; font-weight: bold;">/</span>d
.<span style="color: #000000; font-weight: bold;">/</span>e<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Os diretórios representados por letras são grupos, e dentro temos as categorias de cada grupo. O que eu preciso saber é quantas categorias (diretórios) de grupo existem, sem contar os diretórios dentro das categorias . E agora? Temos os parâmetros -mindepth e -maxdepth. Eles especificam o nível mínimo e máximo para realizar a busca. Neste caso:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-mindepth</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-maxdepth</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-type</span> d</pre></div></div>

<p>Explicando melhor:</p>
<ul>
<li>o nível 0 casa com a linha de comando, ou seja, o ./</li>
<li>o nível 1 casa os nomes de grupo, como ./a e ./b</li>
<li>o nível 2 casa o que eu quero, que são as categorias, como ./a/1 e ./a/2</li>
<li>se usasse apenas o -mindepth 2, a busca continuaria dentro dos diretórios, porque eu disse apenas de onde queria começar a busca, e por isso o -maxdepth é necessário</li>
</ul>
<p>Outras iterações virão em breve. Até <img src='http://ruyrocha.com/wp-includes/images/smilies/icon_wink.gif' alt="icon wink Comando find no Linux" class='wp-smiley' title="Comando find no Linux" /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Comando+find+no+Linux+http%3A%2F%2Fis.gd%2FDYyFAf" title="Post to Twitter"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="tt twitter Comando find no Linux"  title="Comando find no Linux" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Comando+find+no+Linux+http%3A%2F%2Fis.gd%2FDYyFAf" title="Post to Twitter">Tweet This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/linux-comandos-find/&amp;title=Comando+find+no+Linux" title="Post to Delicious"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/delicious/tt-delicious.png" alt="tt delicious Comando find no Linux"  title="Comando find no Linux" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://delicious.com/post?url=http://ruyrocha.com/linux-comandos-find/&amp;title=Comando+find+no+Linux" title="Post to Delicious">Post to Delicious</a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/linux-comandos-find/&amp;title=Comando+find+no+Linux" title="Post to Digg"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg.png" alt="tt digg Comando find no Linux"  title="Comando find no Linux" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://ruyrocha.com/linux-comandos-find/&amp;title=Comando+find+no+Linux" title="Post to Digg">Digg This Post</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/linux-comandos-find/&amp;t=Comando+find+no+Linux" title="Post to Facebook"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook.png" alt="tt facebook Comando find no Linux"  title="Comando find no Linux" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://ruyrocha.com/linux-comandos-find/&amp;t=Comando+find+no+Linux" title="Post to Facebook">Post to Facebook</a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/linux-comandos-find/&amp;title=Comando+find+no+Linux&amp;summary=Inaugurando+a+nova+se%C3%A7%C3%A3o+%28Comandos%29%2C+com+um+breve+post+sobre++como+procurar+arquivos+no+Linux.%0D%0A%0D%0AO+find+%28man+find%29+tem+algumas+coisas+bem+%C3%BAteis.+P...&amp;source=Ruy Rocha" title="Post to LinkedIn"><img class="nothumb" src="http://ruyrocha.com/wp-content/plugins/tweet-this/icons/en/linkedin/tt-linkedin.png" alt="tt linkedin Comando find no Linux"  title="Comando find no Linux" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://ruyrocha.com/linux-comandos-find/&amp;title=Comando+find+no+Linux&amp;summary=Inaugurando+a+nova+se%C3%A7%C3%A3o+%28Comandos%29%2C+com+um+breve+post+sobre++como+procurar+arquivos+no+Linux.%0D%0A%0D%0AO+find+%28man+find%29+tem+algumas+coisas+bem+%C3%BAteis.+P...&amp;source=Ruy Rocha" title="Post to LinkedIn">Post to LinkedIn</a></p></div><div class="al2fb_like_button"><div id="fb-root"></div><script src="http://connect.facebook.net/pt_BR/all.js#appId=159773440769970&amp;xfbml=1" type="text/javascript"></script>
<fb:like href="http://ruyrocha.com/linux-comandos-find/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/linux-comandos-find/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

