Here is an example, using IP provider service IPEcho.net
wget -qO- http://ipecho.net/plain ;echo
The code in action:
[root@devopsrun1 ~]# wget -qO- http://ipecho.net/plain ; echo
In this example, the IP address has been changed for security reasons.
We are adding an echo command to add a newline character at the end of the line, otherwise your bash prompt will appear on the same line where ip address gets printed.