The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Grep help flood Shell Programming and Scripting 3 06-05-2008 10:14 PM
Grep Aejaz UNIX for Advanced & Expert Users 3 04-30-2008 04:10 AM
grep dineshr85 Shell Programming and Scripting 1 10-10-2007 01:52 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-04-2007 11:59 PM
Make grep -c display like grep -n? Jerrad Shell Programming and Scripting 2 08-24-2006 09:20 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-07-2006
Registered User
 

Join Date: Feb 2006
Posts: 3
Stumble this Post!
ls and grep

hi,
i am working on bash shell
i have a dir lets say "abc"
in this dir there are several dirs.
in these dir there are some files
i want to find some text lets say "cool" in all the files in abc dir and it should
display all such files...
also i want to write this command at $ promt..
can anyone tell me...
thanks in advance...
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-07-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,658
Stumble this Post!
Ever thought of trying the search feature of this forum ??

String Search
Reply With Quote
  #3 (permalink)  
Old 03-07-2006
Registered User
 

Join Date: Dec 2005
Location: India
Posts: 218
Stumble this Post!
This was based on some assumptions

Last edited by gauravgoel; 03-07-2006 at 03:35 AM. Reason: better solution given by vino
Reply With Quote
  #4 (permalink)  
Old 03-07-2006
Registered User
 

Join Date: Mar 2006
Posts: 5
Stumble this Post!
Command line answer

$ grep "cool" `find dir. path`

Ex: Searching for a word "DATE" in all the files and subdirectories in "Sgwtools" dir.

$ grep "DATE" `find Sgwtools`
Sgwtools/sam/dummyATE
Sgwtools/genBGwPDPfiles.shATENOW=`date -u '+20%y%m%d%H%M%S'`
Sgwtools/genBGwPDPfiles.sh:echo $DATENOW
Sgwtools/genBGwPDPfiles.sh:#getNewTime $DATENOW $2
$
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:36 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