Command to print network interface and its IP address
Hi All,
I would like to run a script to get all network interfaces and their IP addresses of a standalone PC, such that the command line can print it out.
This device is installed with RedHat Enterprise Linux 7.0.
I have tried the following command but it only showed me one interface and the loopback address.
The command was:
----quote------
hostname --ip-address
----unquote----
There are 2 network interfaces in this PC. but I could only view the interface for the loopback,not the other interface.
How can I get an output in the following manner?
<interface1> <non loopback ip address1>
<interface2> <ip address 2>
Thanks in advance.
|