I was recently creating a virtual machine and installing CentOS 7, when I realized that I needed the ip address of the machine for a certain task. In CentOS 7, it's really easy to get the ip address - here is the command:
In this case, the command returned the following:
mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno16777736: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:c0:60:f8 brd ff:ff:ff:ff:ff:ff inet 192.168.163.131/24 brd 192.168.163.255 scope global dynamic eno16777736 valid_lft 1029sec preferred_lft 1029sec inet6 fe80::20c:29ff:fec0:60f8/64 scope link valid_lft forever preferred_lft forever
The ip address that I was looking for was right there: 192.168.163.131
This is useful if you're trying to set up a local web server for testing or development.