Tuesday, December 1, 2015

Script Get All IPs on Eth

Script Get All IPs on Eth

#!/bin/bash
ETH=$(ip add |grep eth |cut -d: -f2 |awk '{print $1}' |grep eth)

for i in $ETH; do echo "IP on $i: "; ifconfig $i | grep inet | awk '{print $2}' |cut -d: -f2 ;done



No comments:

Post a Comment