The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search for a word on9west Shell Programming and Scripting 2 04-23-2008 12:15 AM
search a word from file vishy Shell Programming and Scripting 9 02-08-2008 01:15 PM
to get a line above the search word sachin.gangadha UNIX for Dummies Questions & Answers 16 01-07-2008 03:19 AM
how can i search word that is under the cursor in VI umen UNIX for Dummies Questions & Answers 4 09-17-2007 11:14 PM
Word search in awk videsh77 Shell Programming and Scripting 8 03-08-2007 07:40 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-18-2007
Registered User
 

Join Date: Feb 2007
Posts: 7
Search about word

Dear

I want syntax to help me to find text or word inside files.

i written the following syntax but i dont take what i need
( find ~ -name ahmad -print )

i need syntax to explain or launch more detail about all files and folder contain ( ahmd ) inside it.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-18-2007
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
Quote:
Originally Posted by abu_hassan
Dear

I want syntax to help me to find text or word inside files.

i written the following syntax but i dont take what i need
( find ~ -name ahmad -print )

i need syntax to explain or launch more detail about all files and folder contain ( ahmd ) inside it.
Code:
find /directory/to/search -exec grep "ahmad" {} /dev/null \;
Reply With Quote
  #3 (permalink)  
Old 02-19-2007
Registered User
 

Join Date: Jan 2007
Posts: 366
Quote:
Originally Posted by vino
Code:
find /directory/to/search -exec grep "ahmad" {} /dev/null \;
I hope you don't have any named pipes within that tree.

On some Linux version if you use this command on /proc it will even result in a system crash.

Better:

Code:
find /directory/to/search -type f -exec grep -il {} \;
Reply With Quote
  #4 (permalink)  
Old 02-19-2007
Registered User
 

Join Date: Jan 2007
Posts: 366
Quote:
Originally Posted by sb008
I hope you don't have any named pipes within that tree.

On some Linux version if you use this command on /proc it will even result in a system crash.

Better:

Code:
find /directory/to/search -type f -exec grep -il {} \;

Oops, typo

Code:
find /directory/to/search -type f -exec grep -il ahmad {} \;
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0