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 220.127.116.11"
it will only print the "18.104.22.168" portion
There is 1 alternative - vote for the best!
This obey that you don't match any broadcast or network addresses and stay between 22.214.171.124 - 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.