centos shell get ip mac address
- font size decrease font size increase font size
- Print Email
--------------------------------mac------------------------
cat /sys/class/net/eth*/address
-------------------------mac-----------------------------
/sbin/ifconfig \ | grep 'eth0' \ | tr -s ' ' \ | cut -d ' ' -f5
------------------ip--------------------------
/sbin/ifconfig \ | grep '\<inet\>' \ | sed -n '1p' \ | tr -s ' ' \ | cut -d ' ' -f3 \ | cut -d ':' -f2
--------------------------mac----------------
ifconfig | grep HWaddr | awk -F" " '{print $5}'
------------------------ip-------------------------
ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'
Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
back to top