Grep IP addresses from a file.
- July 18th, 2008
- Posted in Documentation
- Write comment
egrep โ[[:digit:]]{1,3}โ\.'[[:digit:]]{1,3}โ\.'[[:digit:]]{1,3}โ\.'[[:digit:]]{1,3}โ filename
egrep โ[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}โ filename
Note: this will not exclude invalid IP addresses such as 500.500.500.500, but it is something to start with.
If doing a copy an paste, the single quotes need to be typed manually until I figure out how enter them correctly.
No comments yet.