[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep question
On Tue, 2004-12-07 at 20:49 -0600, Charlie Brune wrote:
> > What is the correct Bash command to search for all occurrences
> > of 'this_string' in all files in a folder and its sub-folders?
>
> How about:
>
> find -type f -exec grep -H "this_string" \;
>
> The "-H" grep option will show the name of the file.
Charlie,
I think the simplest method would be:
$ grep "this_string" -d recurse * <-- with the "" double quotes
This returns:
path_to/filename:<echo of a line containing this_string>
...
-- Doc
Robert G. (Doc) Savage, BSE(EE), CISSP, RHCE | Fairview Heights, IL
Fedora Core 3 kernel 2.6.9-1.681_FC3 on a P-III/M IBM Thinkpad A22p
"Perfection is the enemy of good enough."
-- Admiral of the Fleet Sergei G. Gorshkov
-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.