<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: 15 Practical Grep Command Examples In Linux / UNIX</title>
	<atom:link href="http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/</link>
	<description>Guides, HowTos and Tips for Technology Geeks</description>
	<lastBuildDate>Thu, 09 Feb 2012 11:52:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: edward</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-188354</link>
		<dc:creator>edward</dc:creator>
		<pubDate>Tue, 31 Jan 2012 08:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-188354</guid>
		<description>For example my data is (file.ave) :

MRR 120101000000 UTC+07 AVE    60 STF   150 ASL
H      150    300    450    600    750    900
TF  0.0149 0.0515 0.1171
F00 -67.04 
F01 -69.27

I use grep as:
grep -r &#039;MRR&#039; *.ave &gt; time_0101.txt. In this case all file goes to time_0101.txt, I have many files and I need each output goes to specific file name. Any idea ? And how to use grep to take F00 and F01 ? If I use grep -r &#039;F&#039; *.ave, the first line will be taken also because of  STF, Thanks for help..</description>
		<content:encoded><![CDATA[<p>For example my data is (file.ave) :</p>
<p>MRR 120101000000 UTC+07 AVE    60 STF   150 ASL<br />
H      150    300    450    600    750    900<br />
TF  0.0149 0.0515 0.1171<br />
F00 -67.04<br />
F01 -69.27</p>
<p>I use grep as:<br />
grep -r &#8216;MRR&#8217; *.ave &gt; time_0101.txt. In this case all file goes to time_0101.txt, I have many files and I need each output goes to specific file name. Any idea ? And how to use grep to take F00 and F01 ? If I use grep -r &#8216;F&#8217; *.ave, the first line will be taken also because of  STF, Thanks for help..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gotham</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-182113</link>
		<dc:creator>gotham</dc:creator>
		<pubDate>Sun, 22 Jan 2012 10:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-182113</guid>
		<description>awesome. thanks a lot.</description>
		<content:encoded><![CDATA[<p>awesome. thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: haydarekarrar</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-160288</link>
		<dc:creator>haydarekarrar</dc:creator>
		<pubDate>Fri, 23 Dec 2011 10:29:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-160288</guid>
		<description>Just a minor thing the last result line is removed in the example above, this should be the result: 

$ grep &quot;this&quot; greptest.txt
this line is the 1st lower case line in this file.
Two lines above this line is empty.
And this is the last line.</description>
		<content:encoded><![CDATA[<p>Just a minor thing the last result line is removed in the example above, this should be the result: </p>
<p>$ grep &#8220;this&#8221; greptest.txt<br />
this line is the 1st lower case line in this file.<br />
Two lines above this line is empty.<br />
And this is the last line.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 7 Linux Grep OR, Grep AND, Grep NOT Operator Examples</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-133901</link>
		<dc:creator>7 Linux Grep OR, Grep AND, Grep NOT Operator Examples</dc:creator>
		<pubDate>Fri, 21 Oct 2011 06:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-133901</guid>
		<description>[...] You already knew that grep is extremely powerful based on these grep command examples. [...]</description>
		<content:encoded><![CDATA[<p>[...] You already knew that grep is extremely powerful based on these grep command examples. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-128554</link>
		<dc:creator>Dinesh</dc:creator>
		<pubDate>Thu, 22 Sep 2011 18:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-128554</guid>
		<description>Shyam

grep “[^A-Z]” file.txt

Grep will print the lines that does not start with CAPTIAL LETTERS.

Using ^ inside the [] will do the work opposite to the pattern what you have been searching for ...</description>
		<content:encoded><![CDATA[<p>Shyam</p>
<p>grep “[^A-Z]” file.txt</p>
<p>Grep will print the lines that does not start with CAPTIAL LETTERS.</p>
<p>Using ^ inside the [] will do the work opposite to the pattern what you have been searching for &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-128552</link>
		<dc:creator>Dinesh</dc:creator>
		<pubDate>Thu, 22 Sep 2011 18:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-128552</guid>
		<description>Paul

grep \# input*.txt &#124; awk ‘{print $4}’ &#124; sort &#124; uniq &gt; output.txt

Since # is a special character,we are treating # as # by putting backslash infront of that.
Noe Greap searches for pattern # in a list of file starting as input and nding a txt and then awk prints the 4th field and sort is doing sorting the 4th field returns from awk and unis is doing uniq operation.</description>
		<content:encoded><![CDATA[<p>Paul</p>
<p>grep \# input*.txt | awk ‘{print $4}’ | sort | uniq &gt; output.txt</p>
<p>Since # is a special character,we are treating # as # by putting backslash infront of that.<br />
Noe Greap searches for pattern # in a list of file starting as input and nding a txt and then awk prints the 4th field and sort is doing sorting the 4th field returns from awk and unis is doing uniq operation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sudheer</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-126683</link>
		<dc:creator>sudheer</dc:creator>
		<pubDate>Sun, 11 Sep 2011 02:32:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-126683</guid>
		<description>1)	Use grep (or awk) to output all lines in a given file which contain employee ID numbers. Assume that each employee ID number consists of 1-4 digits followed by two letters: the first is either a W or a S and the second is either a C or a T. ID numbers never start with 0s. Further assume that an employee ID is always proceeded by some type of white space – tab, blank, new line etc. However, there might be characters after it, for example punctuation. 
What to turn in: Turn in three things: 

a.	A file with the regular expression which can directly be used by grep (or awk) 

b.	A text file which you used to test your regular expression. Make sure that you include valid and ‘invalid’ employee IDs, have them at the beginning and the end of lines, sentences, etc. 

c.	A second document which re-writes the regular expression in a more human-readable form and explains the purpose of the different components of the regular expression. Also include a short explanation of your test cases. 

2)	Use grep (or awk) to output all the lines in a given file which contain a decimal number (e.g. a number which includes a decimal point). Decimal numbers do not have leading zeros but they might have trailing zeros. Assume the number is always surrounded by white space. 

What to turn in: The same three things as above (except, of course, for this problem). 

3)	Write a regular expression for the valid identifiers in Java. You are allowed to use ‘shortcuts’, but need to make sure that you specify exactly what they are (e.g. if you use digit specify that that means 0, 1, 2, 3, ….9.)</description>
		<content:encoded><![CDATA[<p>1)	Use grep (or awk) to output all lines in a given file which contain employee ID numbers. Assume that each employee ID number consists of 1-4 digits followed by two letters: the first is either a W or a S and the second is either a C or a T. ID numbers never start with 0s. Further assume that an employee ID is always proceeded by some type of white space – tab, blank, new line etc. However, there might be characters after it, for example punctuation.<br />
What to turn in: Turn in three things: </p>
<p>a.	A file with the regular expression which can directly be used by grep (or awk) </p>
<p>b.	A text file which you used to test your regular expression. Make sure that you include valid and ‘invalid’ employee IDs, have them at the beginning and the end of lines, sentences, etc. </p>
<p>c.	A second document which re-writes the regular expression in a more human-readable form and explains the purpose of the different components of the regular expression. Also include a short explanation of your test cases. </p>
<p>2)	Use grep (or awk) to output all the lines in a given file which contain a decimal number (e.g. a number which includes a decimal point). Decimal numbers do not have leading zeros but they might have trailing zeros. Assume the number is always surrounded by white space. </p>
<p>What to turn in: The same three things as above (except, of course, for this problem). </p>
<p>3)	Write a regular expression for the valid identifiers in Java. You are allowed to use ‘shortcuts’, but need to make sure that you specify exactly what they are (e.g. if you use digit specify that that means 0, 1, 2, 3, ….9.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 20 Linux Log Files that are Located under /var/log Directory</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-120256</link>
		<dc:creator>20 Linux Log Files that are Located under /var/log Directory</dc:creator>
		<pubDate>Mon, 01 Aug 2011 06:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-120256</guid>
		<description>[...] what you are looking for in a log file, you can quickly use grep command to grep a pattern. The 15 practical grep examples will take out all your excuses of not using [...]</description>
		<content:encoded><![CDATA[<p>[...] what you are looking for in a log file, you can quickly use grep command to grep a pattern. The 15 practical grep examples will take out all your excuses of not using [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shivaraj Patil</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-119284</link>
		<dc:creator>shivaraj Patil</dc:creator>
		<pubDate>Mon, 25 Jul 2011 17:14:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-119284</guid>
		<description>HI i have a file with this values
100     first line
101     second line
101
102
102
109
now i need a script that can take two lines and find which is greatest</description>
		<content:encoded><![CDATA[<p>HI i have a file with this values<br />
100     first line<br />
101     second line<br />
101<br />
102<br />
102<br />
109<br />
now i need a script that can take two lines and find which is greatest</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shyam</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-106227</link>
		<dc:creator>shyam</dc:creator>
		<pubDate>Mon, 30 May 2011 04:45:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-106227</guid>
		<description>i have a doubt here i tried to look at output of cmd

grep &quot;[^A-Z]&quot; file.txt

this is showing all characters excluding capital letter 
what does this command actually do</description>
		<content:encoded><![CDATA[<p>i have a doubt here i tried to look at output of cmd</p>
<p>grep &#8220;[^A-Z]&#8221; file.txt</p>
<p>this is showing all characters excluding capital letter<br />
what does this command actually do</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Content Delivery Network via Amazon Web Services: CloudFront: static.thegeekstuff.com

Served from: www.thegeekstuff.com @ 2012-02-09 12:53:58 -->
