Tutorials  Articles  Notifications  Login  Signup


VS

Vishal Saxena

SDE 1 at Amazon June 29, 2023, 2:15 p.m. ⋅ 2214 views

Linux command to know your public IP


To know your public IP from linux terminal or ubuntu terminal you can use curl command. 

curl https://ipinfo.io/ip

This will show your public IP address.

you can also try using:

curl -s https://ipinfo.io/ip

This will show you public IP address and it's fail proof. So even if curl command fails, it will fail silently without failing the whole process.



HackerFriend Logo

Join the community of 1 Lakh+ Developers

Create a free account and get access to tutorials, jobs, hackathons, developer events and neatly written articles.


Create a free account