DEV Community

Cover image for Find Out Your IP on Ubuntu & macOS
Jonas Schumacher
Jonas Schumacher

Posted on

3 1

Find Out Your IP on Ubuntu & macOS

So at some point you will want to know your own IP Address. And when that time comes, here is how to do it.

If you are on macOS:

ifconfig | grep inet
Enter fullscreen mode Exit fullscreen mode

This will give you a list of IPv4 and IPv6 addresses. Grab the one that says inet next to it and that should be it.

If you are on Ubuntu:

ip addr show
Enter fullscreen mode Exit fullscreen mode

Now this I just love. You could even shorten that to ip a if you wanted to, but why would you with such a beautifully descriptive command?

If ip addr show gives you too much information, hostname -I does the trick as well, only more focused.

Sources:
https://osxdaily.com/2010/11/21/find-ip-address-mac/
https://itsfoss.com/check-ip-address-ubuntu/

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay