Question

I'm trying to grep -R an exact version of apache.
I leave the include and the manuals, because its not necessary to change.
This is the command I'm using:

grep -R 2.2.24 * | grep -v manual | grep -v include | cut -d':' -f 1

I would like to know how to find one result per file?
Thanks

Was it helpful?

Solution

The cut in your command suggests that you're looking to list files matching the specified string.

find . ! -path "*/manual/*" ! -path "*/include/*" -type f -exec grep -Fl 2.2.24 {} \;

should work for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top