<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://andromeda.df.lu.lv/wiki/index.php?action=history&amp;feed=atom&amp;title=Grep_notes</id>
	<title>Grep notes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://andromeda.df.lu.lv/wiki/index.php?action=history&amp;feed=atom&amp;title=Grep_notes"/>
	<link rel="alternate" type="text/html" href="http://andromeda.df.lu.lv/wiki/index.php?title=Grep_notes&amp;action=history"/>
	<updated>2026-04-16T20:15:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>http://andromeda.df.lu.lv/wiki/index.php?title=Grep_notes&amp;diff=693&amp;oldid=prev</id>
		<title>Leo: New page: Simple things first: search for a pattern recursively in all files, ignore the case, and display the line number in the files where found:  grep -rin &#039;mypattern&#039; *   Sometimes you do not w...</title>
		<link rel="alternate" type="text/html" href="http://andromeda.df.lu.lv/wiki/index.php?title=Grep_notes&amp;diff=693&amp;oldid=prev"/>
		<updated>2009-05-13T11:50:31Z</updated>

		<summary type="html">&lt;p&gt;New page: Simple things first: search for a pattern recursively in all files, ignore the case, and display the line number in the files where found:  grep -rin &amp;#039;mypattern&amp;#039; *   Sometimes you do not w...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Simple things first: search for a pattern recursively in all files, ignore the case, and display the line number in the files where found:&lt;br /&gt;
 grep -rin &amp;#039;mypattern&amp;#039; *&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sometimes you do not want to find certain things - use &amp;#039;-v&amp;#039; for that:&lt;br /&gt;
 grep -v &amp;#039;mypattern&amp;#039; *&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
My favorite alias for &amp;#039;&amp;#039;&amp;#039;grep&amp;#039;&amp;#039;&amp;#039; - excludes &amp;lt;code&amp;gt;*/.svn/*&amp;lt;/code&amp;gt; files and only looks in certain file types. The find command goes through the directories and prepares a list of file names, then xargs them into egrep. Note, if you have file names starting with &amp;#039;-&amp;#039;, you may have a problem using this.&lt;br /&gt;
&lt;br /&gt;
 alias mygrep=&amp;#039;find . | grep -v &amp;quot;\.\/svn\/&amp;quot; | egrep &amp;quot;\.(c|cpp|h|java|html|rb|rhtml|css)$&amp;quot; | xargs egrep -n&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that grep and egrep differ, for example, that in grep you can not ask for match this or that, for example, &amp;quot;(aaa|bbb)&amp;quot;, but in egrep you can.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nice and concise article on grep and regex usage:&lt;br /&gt;
http://www.wellho.net/regex/grep.html&lt;/div&gt;</summary>
		<author><name>Leo</name></author>
		
	</entry>
</feed>