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

Re: Finding files containing 'string'





> I had two suggestions:
> 1. gnome-search-tool
> 2. find ./ -name "*" -exec grep "string" {} /dev/null \;
>
> Someone suggested even a better command solution than 2. above but I
> can't remember what it is.
> --

find . -type f -print0 |xargs -0 grep "string"

should work.


..err...my sugestion is much simple...

grep -e <string> <files>

the for example:
grep -e Daniel *.html

will show me in wich file the line WITH the string "Daniel" will appear.
being more efficient, you can place another flag to show you the exact line number.

No need of cat, nor more to search on every file on a directory...haven't tryed yet on a full root search.

Hiope it helps.



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