searching insed(ide) files

Konrad Heuer kheuer2 at gwdg.de
Mon Apr 7 05:06:31 PDT 2003


On Mon, 7 Apr 2003, CARTER Anthony wrote:

> I am looking for a way to search inside a number of text files for a
> particular string and return the name of the file if found. Any ideas?

grep -c string file file ... | grep '1$' | sed 's/:.*$//'

Regards

Konrad Heuer (kheuer2 at gwdg.de)  ____            ___  _______
GWDG                           / __/______ ___ / _ )/ __/ _ \
Am Fassberg                   / _// __/ -_) -_) _  |\ \/ // /
37077 Goettingen             /_/ /_/  \__/\__/____/___/____/
Germany




More information about the freebsd-questions mailing list