<?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>EveryJoe &#187; search inside files</title>
	<atom:link href="http://www.everyjoe.com/tag/search-inside-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.everyjoe.com</link>
	<description>Sports News - Tech Reviews - Entertainment - Life Tips for EveryJoe</description>
	<lastBuildDate>Wed, 09 Dec 2009 22:11:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Your PC Using Find</title>
		<link>http://www.everyjoe.com/articles/google-your-pc-using-find-2/</link>
		<comments>http://www.everyjoe.com/articles/google-your-pc-using-find-2/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 12:00:56 +0000</pubDate>
		<dc:creator>Sravan</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Cool Software]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[Google desktop search]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[piping]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[search file content]]></category>
		<category><![CDATA[search inside files]]></category>
		<category><![CDATA[Windows desktop search]]></category>

		<guid isPermaLink="false">http://www.thatdamnpc.com/?p=1290</guid>
		<description><![CDATA[find is an elaborate search program with a number of features. Unlike the Google Desktop Search and locate, it doesn’t index anything but processes the request on the fly. Thus it is slower.
find is one of the most useful commands when you also have to search within unknown files and make further operations on the result set. It does a recursive search, looking in all subdirectories.
The first set of arguments is always the paths where the search should initiate. $ find /home /tmp &#60;remaining arguments&#62; would search based on the remaining arguments in /home, /tmp and all their subdirectories. If [...]<p>Post from: <a href="http://www.everyjoe.com">EveryJoe</a></p>
<p><a href="http://www.everyjoe.com/articles/google-your-pc-using-find-2/">Google Your PC Using Find</a></p>
]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Lucida Console;">find</span> is an elaborate search program with a number of features. Unlike the Google Desktop Search and <span style="font-family: Lucida Console;"><a title="That Damn PC: Locate, A Desktop Search Alternative" href="http://www.everyjoe.com/locate-a-desktop-search-alternative/" target="_self">locate</a></span>, it doesn’t index anything but processes the request on the fly. Thus it is slower.</p>
<p><span style="font-family: Lucida Console;">find</span> is one of the most useful commands when you also have to search within unknown files and make further operations on the result set. It does a recursive search, looking in all subdirectories.</p>
<p>The first set of arguments is always the paths where the search should initiate. <span style="font-family: Lucida Console;">$ find /home /tmp &lt;remaining arguments&gt;</span> would search based on the remaining arguments in /home, /tmp and all their subdirectories. If unspecified, the default path is taken as ‘.’, the current working directory.</p>
<p>To search for a specific filename pattern, <span style="font-family: Lucida Console;">–name &lt;regexp&gt;</span> is used as the next argument. <span style="font-family: Lucida Console;">$ find /home /tmp –name *.sh</span> returns all .SH files present in /home, /tmp and their subdirectories.</p>
<p>Instead of piping, to perform any operation on each of the results returned, <span style="font-family: Lucida Console;">–exec</span> is used. <span style="font-family: Lucida Console;">$ find /home /tmp –name *.sh –exec grep todo ‘{}’ \; –print</span><span style="font-family: verdana;"> searches for the string todo in the above returned files. </span><span style="font-family: Lucida Console;">grep</span> does the search and ‘{}’ implies that all results need to be processed. The <span style="font-family: Lucida Console;">–print</span> prints the final output, the actual lines containing the specified string in the files.</p>
<p><span style="font-family: verdana;">Instead of </span><span style="font-family: Lucida Console;">grep</span>, it could be <span style="font-family: Lucida Console;">chmod</span> or <span style="font-family: Lucida Console;">chown</span> or any operation that can be done of files. These above options are the most common use cases of <span style="font-family: Lucida Console;">find</span>.</p>
<p><span style="font-family: verda;">There are</span> a number of other options to refine the search like complex expressions with boolean operators, the maximum and minimum depth of subdirectories that need to be traversed, the modification times and permissions on files, the file types, etc. You can read about all these in the <a title="Unix Find Manual Page" href="http://unixhelp.ed.ac.uk/CGI/man-cgi?find">manual page</a>.</p>
<p>Post from: <a href="http://www.everyjoe.com">EveryJoe</a></p>
<p><a href="http://www.everyjoe.com/articles/google-your-pc-using-find-2/">Google Your PC Using Find</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.everyjoe.com/articles/google-your-pc-using-find-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>