[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ls -R | grep char_string



> I would like to search all files in the current und subdirs for a
> char_string.
> Why does this commandstring not work?:
>
> ls -R | grep char_string
>
> No error , no nothing - although this certain char_string is in a
> simple ASCII text file!

You are searching for a string in the name of all files in the
current dir and subdirs, but I think you want to search for a string 
_within_ all files.

Therefore you have to do something like that:
find . -exec grep -H char_string {} \; 2>/dev/null

Regards,
Christoph.



Reply to: