Command of the Day

#find + egrep

Command of the Day:

If you see my previous couple of post you would be comfortable to use “egrep” and “find” utilities.

Here One Question arises on me:

How would you combine both commands like you need to find some file in your disk also you have find the string from that file:

my thoughts:

find . -name “nava.txt” | egrep -in “NAVANEETHAN”

Is it correct? Why it is not correct?

find . -name “nava.txt” -exec egrep “NAVANEETHAN” {} \;

(or)

find . -name “nava.txt” -print0 | xargs -0 egrep “NAVANEETHAN” refer    

Advertisements

About Navaneethan

mixed feelings...
This entry was posted in CoD, Free Software. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s