How to get ip address of a server on Centos 7 in bash
You can use hostname command : ipaddr=$(hostname -I) -i, –ip-address: Display the IP address(es) of the host. Note that this works only if the host name can be resolved. -I, –all-ip-addresses: Display all network addresses of the host. This option enumerates all configured addresses on all network interfaces. The loopback interface and IPv6 link-local addresses … Read more