How to Show Your IP Address in Linux
Knowing your IP address in Linux is one of those fundamental tasks that comes up constantly — whether you're configuring a server, troubleshooting a network issue, setting up SSH access, or just getting your bearings on a new machine. The good news: Linux gives you several ways to find it, each suited to different situations and system configurations.
What "IP Address" Actually Means in This Context
Before diving into commands, it's worth clarifying what you're looking for. Your Linux machine likely has more than one IP address:
- Local (private) IP address — assigned by your router, visible only within your network (e.g., 192.168.1.x or 10.0.0.x)
- Public (external) IP address — assigned by your ISP, visible to the outside internet
- Loopback address — always 127.0.0.1, used internally by the system itself
- IPv4 vs. IPv6 — modern systems often have both; commands will show either or both depending on flags you use
Most people asking this question want their local network IP — what you'd use to connect to this machine from another device on the same network.
The Main Commands for Showing Your IP Address 🖥️
ip addr — The Modern Standard
The ip command is the current recommended tool on most Linux distributions. It replaced the older ifconfig command and comes pre-installed on virtually all modern systems.