<?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: Get a Grip on the Grep! &#8211; 15 Practical Grep Command Examples</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>Mon, 15 Mar 2010 16:15:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anonymous</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-38395</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 08 Mar 2010 10:26:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-38395</guid>
		<description>Hi,

Those lines are the contents of the text file and I don’t want to change the actual directory or the file on server. I want to change the contents of the file where all file file names ending at the line should be removed. So the final file contents should look like this

cat filecontenet.txt
/usr/home/htdocs/drag-and-drop/
/usr/home//htdocs/sms/publish/pages/
/usr/home/htdocs/track/
/usr/home/htdocs/smstest/
/usr/home/htdocs/
/usr/home/htdocs/

I think rename would not help here in editing file contents.

for this question ,  awk really helpful with single line command

go to the current directory
ls -l &#124; grep -v ^d &#124; awk &#039;{print $9}&#039;  &gt; new.txt

$9 -- is the last filed which is filename only when u list with option ls -l , 
new.txt contains only the filenames which you wnated to filter out</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Those lines are the contents of the text file and I don’t want to change the actual directory or the file on server. I want to change the contents of the file where all file file names ending at the line should be removed. So the final file contents should look like this</p>
<p>cat filecontenet.txt<br />
/usr/home/htdocs/drag-and-drop/<br />
/usr/home//htdocs/sms/publish/pages/<br />
/usr/home/htdocs/track/<br />
/usr/home/htdocs/smstest/<br />
/usr/home/htdocs/<br />
/usr/home/htdocs/</p>
<p>I think rename would not help here in editing file contents.</p>
<p>for this question ,  awk really helpful with single line command</p>
<p>go to the current directory<br />
ls -l | grep -v ^d | awk &#8216;{print $9}&#8217;  &gt; new.txt</p>
<p>$9 &#8212; is the last filed which is filename only when u list with option ls -l ,<br />
new.txt contains only the filenames which you wnated to filter out</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abhishek</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-35646</link>
		<dc:creator>abhishek</dc:creator>
		<pubDate>Sun, 21 Feb 2010 10:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-35646</guid>
		<description>content was very useful</description>
		<content:encoded><![CDATA[<p>content was very useful</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joeq</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-32595</link>
		<dc:creator>joeq</dc:creator>
		<pubDate>Thu, 04 Feb 2010 09:57:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-32595</guid>
		<description>hi
i got 1 problem...how can i find a numbers like 99,000,000.95 in my server database using unix command..
tq</description>
		<content:encoded><![CDATA[<p>hi<br />
i got 1 problem&#8230;how can i find a numbers like 99,000,000.95 in my server database using unix command..<br />
tq</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Floyd</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-32026</link>
		<dc:creator>Jeff Floyd</dc:creator>
		<pubDate>Tue, 02 Feb 2010 00:54:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-32026</guid>
		<description>Whats the difference between $ grep -c ill memo and $ grep -n ill memo?</description>
		<content:encoded><![CDATA[<p>Whats the difference between $ grep -c ill memo and $ grep -n ill memo?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghu Baba</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-31545</link>
		<dc:creator>Raghu Baba</dc:creator>
		<pubDate>Sat, 30 Jan 2010 10:44:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-31545</guid>
		<description>Hai.. I want to Parse my file .. Word to Excel .. so tell me some grep &amp; cut commands...</description>
		<content:encoded><![CDATA[<p>Hai.. I want to Parse my file .. Word to Excel .. so tell me some grep &amp; cut commands&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eMancu</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-30788</link>
		<dc:creator>eMancu</dc:creator>
		<pubDate>Sun, 24 Jan 2010 18:49:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-30788</guid>
		<description>Awsome tutorial!
I&#039;m reading all your blog, its amazing!</description>
		<content:encoded><![CDATA[<p>Awsome tutorial!<br />
I&#8217;m reading all your blog, its amazing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fety</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-29069</link>
		<dc:creator>fety</dc:creator>
		<pubDate>Mon, 11 Jan 2010 09:32:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-29069</guid>
		<description>thanks very much for this tutorial. it is very helpful..</description>
		<content:encoded><![CDATA[<p>thanks very much for this tutorial. it is very helpful..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jawn Hewz</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-26926</link>
		<dc:creator>Jawn Hewz</dc:creator>
		<pubDate>Tue, 22 Dec 2009 01:54:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-26926</guid>
		<description>Does the -b (byte offset) work when greping binary files?  I do not get an offset returned when I grep a binary file, but I do when using a text file.  I am using grep under Cygwin.</description>
		<content:encoded><![CDATA[<p>Does the -b (byte offset) work when greping binary files?  I do not get an offset returned when I grep a binary file, but I do when using a text file.  I am using grep under Cygwin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Varun</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-26475</link>
		<dc:creator>Varun</dc:creator>
		<pubDate>Thu, 17 Dec 2009 13:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-26475</guid>
		<description>Hi,
The options mentioned in point 6 for displaying the context with A, B, &amp; C does not seem to work on Solaris 10 with both grep &amp; egrep

Is there a version of this grep available for Solaris?

Thank you,
Varun.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
The options mentioned in point 6 for displaying the context with A, B, &amp; C does not seem to work on Solaris 10 with both grep &amp; egrep</p>
<p>Is there a version of this grep available for Solaris?</p>
<p>Thank you,<br />
Varun.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish</title>
		<link>http://www.thegeekstuff.com/2009/03/15-practical-unix-grep-command-examples/comment-page-1/#comment-24445</link>
		<dc:creator>Ashish</dc:creator>
		<pubDate>Tue, 01 Dec 2009 22:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=433#comment-24445</guid>
		<description>Hi,

I need to sthing like this
I have a file containing 400 domainId values seprated by new line
ex. domain.txt
domain1
domain2
domain3…

I have a script that takes each domain and calls an api that returns me an xml.
like this for each domain

&lt;tag1&gt;val1&lt;/tag1&gt;
&lt;domain&gt;domain1&lt;/domain&gt;
&lt;tag2&gt;val2&lt;/tag2&gt;
&lt;tag3&gt;val3&lt;/tag3&gt;
&lt;tag4&gt;val4&lt;/tag4&gt;
&lt;domainid&gt;XXX&lt;/domainid&gt;
&lt;tag5&gt;val1&lt;/tag5&gt;

now i want to spit out the domain name in a file that does not matches domainid value XXX.

how can i do it using grep
TIA</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I need to sthing like this<br />
I have a file containing 400 domainId values seprated by new line<br />
ex. domain.txt<br />
domain1<br />
domain2<br />
domain3…</p>
<p>I have a script that takes each domain and calls an api that returns me an xml.<br />
like this for each domain</p>
<p>&lt;tag1&gt;val1&lt;/tag1&gt;<br />
&lt;domain&gt;domain1&lt;/domain&gt;<br />
&lt;tag2&gt;val2&lt;/tag2&gt;<br />
&lt;tag3&gt;val3&lt;/tag3&gt;<br />
&lt;tag4&gt;val4&lt;/tag4&gt;<br />
&lt;domainid&gt;XXX&lt;/domainid&gt;<br />
&lt;tag5&gt;val1&lt;/tag5&gt;</p>
<p>now i want to spit out the domain name in a file that does not matches domainid value XXX.</p>
<p>how can i do it using grep<br />
TIA</p>
]]></content:encoded>
	</item>
</channel>
</rss>
