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


Originally published at:

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?


I use this command:

wget -qO -

Example output:

[root@BERTHA ~]# wget -qO -


For that : open the terminal and type “curl