I want to print my public IP address in the terminal. I found a webpage called http://ipecho.net/plain, it only displays the IP address.
What is the simplest way to print it to my bash?
Is it something close to wget http://ipecho.net/plain | cat plain or echo $(wget http://ipecho.net/plain)? (none of the above mentioned commands prints the expected output)
Thanks, Polb
With wget, you have to tell it not to show the progress bars, and to send output to stdout instead of a file:
wget -q -O- http://ipecho.net/plain
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With