Re: Finding files containing 'string'

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

 





> 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.



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux