On 30/06/16 11:14, Mark Rogers wrote:
Is there a quick way to search all text files for a string?
By "text file" I mean ASCII files, like log files, config files etc, but excluding binaries like executables, database files, etc?
What I want is something like: find / -type a -exec grep 192.168.100.1 {} ; .. or similar, except that I made up "-type a" for ascii.
(I'm trying to find all places that an IP address is mentioned so that I can change ones that need to be changed.)
This is what I use:
#### wild card grep:
find [dir] -type f | xargs grep -i "string"
#### find filenames containing string:
find [dir] -type f | xargs grep -liH "string"
Cheers, Laurie.