Originally Posted by masterav
I need to grep a ip adress from the file mentioned below using wildcards.
assuming that all IPs are given in decimal, the following line should do the job:
grep -wo "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*" <filename>
See "man grep" for an explanation of -w and -o. The regular expression is a bit too tolerant (for example, it would also match "1000.0.0.0"), but that should not be a problem in practice.