To display the IP address of a specific network interface using the ip command, you can specify the interface name directly. Here’s how to do it:
ip addr show <interface_name>
Example:
If you want to display the details for an interface named eth0, you would use:
ip addr show eth0
Output:
This will show all the details related to the eth0 interface, including its IP address, subnet mask, and other relevant information.
If you want to filter for just the IPv4 address, you can combine it with grep:
ip addr show eth0 | grep inet
This will display only the IPv4 address assigned to eth0. Let me know if you need more help!
