|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
find . -exec grep -l 'toto' {} \;
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
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
|
|||
|
|||
|
yeclota,
Dont use like this, find . -exec grep -l 'toto'{}\; Use like this. find . -exec grep -l 'toto'<<spaces>>{}<<spaces>>\; |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
It's Ok
It's Ok, Thanks for your help.
Lota |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find files only in current directory...not subdirectories | vsachan | Shell Programming and Scripting | 2 | 02-09-2012 12:43 PM |
| Find and replace a word in all the files (that contain the word) under a directory | filter | Shell Programming and Scripting | 5 | 10-05-2011 12:22 AM |
| to parse a directory and its subdirectories and find owner name of files | vyasa | Shell Programming and Scripting | 14 | 05-29-2009 05:43 AM |
| Find Files in a Directory Excluding Subdirectories | Amol_Dicholkar | UNIX for Dummies Questions & Answers | 2 | 12-11-2008 06:54 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 |
|
|