<?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>SavvyAdmin.com &#187; Grep</title>
	<atom:link href="http://savvyadmin.com/tag/grep/feed/" rel="self" type="application/rss+xml" />
	<link>http://savvyadmin.com</link>
	<description>For savvy admins everywhere...</description>
	<lastBuildDate>Fri, 21 Jan 2011 17:53:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Grep in Color</title>
		<link>http://savvyadmin.com/grep-in-color/</link>
		<comments>http://savvyadmin.com/grep-in-color/#comments</comments>
		<pubDate>Sun, 02 Sep 2007 16:24:43 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Grep]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/2007/09/02/grep-in-color/</guid>
		<description><![CDATA[If you would like to make it easier to visually spot what you are looking for when using &#8220;grep&#8221;, try out the &#8220;&#8211;color&#8221; flag. This option highlights any matches in the output of your search, giving you an upper hand when trying to visually scan through complicated or cumbersome sequences. For example, if you were [...]
Related posts:<ol>
<li><a href='http://savvyadmin.com/useful-apt-aliases/' rel='bookmark' title='Useful APT Aliases'>Useful APT Aliases</a></li>
<li><a href='http://savvyadmin.com/vim-in-color/' rel='bookmark' title='Vim in Color'>Vim in Color</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you would like to make it easier to visually spot what you are looking for when using &#8220;grep&#8221;, try out the &#8220;&#8211;color&#8221; flag.  This option highlights any matches in the output of your search, giving you an upper hand when trying to visually scan through complicated or cumbersome sequences.</p>
<p>For example, if you were looking for any IP address in your /etc/hosts.deny file that has the number &#8220;209&#8243; in it, issue the following command:</p>
<blockquote><p><code><strong>grep --color 209 /etc/hosts.deny</strong></code></p></blockquote>
<p>Here is the comparison of the same output, with and without the color option.</p>
<p style="text-align: center;"><img src="https://www.savvyadmin.com/wp-content/uploads/2007/09/grep-no-color.png" alt="Grep with no color" /> <img src="https://www.savvyadmin.com/wp-content/uploads/2007/09/grep-color.png" alt="Grep with color" /></p>
<p>As you can see, one might find it very easy to miss the fact that there are some IP addresses that have multiple octets with the value of 209.  The color flag really comes in handy.</p>
<p><strong>UPDATE (12/13/2009):</strong> In the most recent versions of Ubuntu, a local alias has been defined in the default .bashrc for each user.  This alias gives turns on color highlighting with the following line.</p>
<blockquote><p><code>alias grep='grep --color=auto'</code></p></blockquote>
<p>Related posts:<ol>
<li><a href='http://savvyadmin.com/useful-apt-aliases/' rel='bookmark' title='Useful APT Aliases'>Useful APT Aliases</a></li>
<li><a href='http://savvyadmin.com/vim-in-color/' rel='bookmark' title='Vim in Color'>Vim in Color</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/grep-in-color/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

