0

I am using Red Hat Enterprise 6 and I'm trying to search through the /etc/ directory for files that contain any IPv4 address.

  • @JeffSchaller im trying to get any ipv4 address – Sam Feb 9 at 20:40
1

Sure:

grep -lrE '([0-9]{1,3}\.){3}[0-9]{1,3}' /etc

  • -l means list only matching files
  • -r is recursive
  • -E is extended regex

Regex taken from https://unix.stackexchange.com/a/296597/243015

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.