How To Find My Public IP Address From Command Line On a Linux


#1

Originally published at: https://www.cyberciti.biz/faq/how-to-find-my-public-ip-address-from-command-line-on-a-linux/

How do I find out my public IP address on the Linux and OS X Unix command line to use with my own bash shell script without using third party web site? Is there command-line option which will show my dynamic IP address on a Ubuntu or Fedora Linux?


#2

I use this command:

wget http://ipinfo.io/ip -qO -

Example output:

[root@BERTHA ~]# wget http://ipinfo.io/ip -qO -
xx.152.198.xxx

#3

For that : open the terminal and type “curl ifconfig.me