How to Get My Public IP Address using Linux curl Command

In this tutorial we are going to learn how find Public IP Address of our computer using Linux curl command.

Normally, if we want to find the public IP Address we use, we go to google and search “what is my ip address”. But if you use Linux, you can get your public IP Address from the command line using curl command.

The curl command with ifconfig.me argument will show your public IP Address.

curl ifconfig.me

How to Get My Public IP Address using Linux curl Command

For Additional information use curl ifconfig.me/all.

curl ifconfig.me/all

The output will show the public IP Address, user agent and the port you are connected.

curl what is my ip

So that is how we can easily get the public IP Address using Linux curl command.