The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to remove directory with subdirectories and files? ppa108 UNIX for Dummies Questions & Answers 9 11-25-2008 02:02 AM
shell script to find and copy the files creted in the year 2006 to another directory manas6 Shell Programming and Scripting 2 04-01-2008 03:04 AM
Find all files created by a specified user in a directory and its subdirectories abhilashnair UNIX for Dummies Questions & Answers 5 06-13-2007 02:37 AM
searching files through all subdirectories beneath the current directory milagros Shell Programming and Scripting 5 05-15-2007 04:00 PM
list largest files in a directory & its subdirectories igidttam UNIX for Dummies Questions & Answers 6 09-25-2006 11:31 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-29-2008
yeclota yeclota is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 16
Shell:Find a word in files in a directory and subdirectories

I'm looking to write a ksh code with will be alble to find a word like 'toto' in all files going from my current directory.

eg.

/doc ----------->have: text.c which "toto"
/doc/usr-------->have: build.pc, help.java which "toto"
/doc/usr/cach -->have: test.sh which "toto"
/doc/build ------>Have Succes.ls which "toto"

Can you help me whith a code source?

Thanks
  #2 (permalink)  
Old 08-29-2008
manosubsulo manosubsulo is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 87
find . -exec grep -l 'toto' {} \;
  #3 (permalink)  
Old 08-29-2008
yeclota yeclota is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 16
find . -exec grep -l 'toto' {} \

find . -exec grep -l 'toto'{}\;

return
find: 0652-018 An expression term lacks a required parameter.

can you give me some details because i'm not an expert in shell programming.

Thanks.
  #4 (permalink)  
Old 08-29-2008
manosubsulo manosubsulo is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 87
yeclota,

Dont use like this,

find . -exec grep -l 'toto'{}\;

Use like this.

find . -exec grep -l 'toto'<<spaces>>{}<<spaces>>\;
  #5 (permalink)  
Old 08-29-2008
yeclota yeclota is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 16
It's Ok

It's Ok, Thanks for your help.

Lota
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0