Check IP address in terminal on Linux

in #linux8 years ago

One line is just as good as the next. Pick your poison:

curl -4 ifconfig.me
curl -s httpbin.org/ip
curl -s http://whatismyip.org/ | grep -oP '(\d{1,3}\.){3}\d+'
curl -s http://wtfismyip.com/text
curl l2.io/ip
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"



Credits: commandlinefu

P.S.: The <pre> tag could use some margin-bottom somewhere in the steemit.com css. Just saying.