Grep for IP address with regular expressions, recursive directory search, only matching

Grep is powerful search. Here is how to grep for an IP address within a directory (.) with regular expressions (E), recursive directory search (r) and only matching (o)

grep -oEr "([0-9]{1,3}\.){3}[0-9]{1,3}" .

Happy searching.

Leave a Reply

Your email address will not be published. Required fields are marked *