commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
if you want to only print the IP address from a file.
In this case the file will be called "iplist" with a line like "ip address 126.96.36.199"
it will only print the "188.8.131.52" portion
There is 1 alternative - vote for the best!
This obey that you don't match any broadcast or network addresses and stay between 184.108.40.206 - 254.254.254.254
Handles everything except octets with 255. Ran through ip generator with variable octet lengths.
regex to match an ip
If you can do better, submit your command here.
You must be signed in to comment.