{"id":378,"date":"2013-05-19T05:09:03","date_gmt":"2013-05-19T05:09:03","guid":{"rendered":"https:\/\/shan.info\/new\/centos-shell-get-ip-mac-address\/"},"modified":"2013-05-19T05:09:03","modified_gmt":"2013-05-19T05:09:03","slug":"centos-shell-get-ip-mac-address","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/centos-shell-get-ip-mac-address\/","title":{"rendered":"centos shell get ip mac address"},"content":{"rendered":"<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;mac&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>cat \/sys\/class\/net\/eth*\/address<\/p>\n<p>\u00a0<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-mac&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<pre style=\"overflow: auto; line-height: 20.796875px;\">\/sbin\/ifconfig \r\n   | grep 'eth0' \r\n   | tr -s ' ' \r\n   | cut -d ' ' -f5<br \/><br \/>------------------ip--------------------------<\/pre>\n<pre style=\"overflow: auto;\">\/sbin\/ifconfig \r\n   | grep '&lt;inet&gt;' \r\n   | sed -n '1p' \r\n   | tr -s ' ' \r\n   | cut -d ' ' -f3 \r\n   | cut -d ':' -f2<br \/>--------------------------mac----------------<br \/><span style=\"color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal;\">ifconfig | grep HWaddr | awk -F\" \" '{print $5}'<br \/><br \/>------------------------ip-------------------------<br \/><\/span><span style=\"color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; white-space: normal;\">ifconfig eth0 | grep \"inet addr\" | awk -F: '{print $2}' | awk '{print $1}'<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;mac&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; cat \/sys\/class\/net\/eth*\/address \u00a0 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-mac&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \/sbin\/ifconfig | grep &#8216;eth0&#8217; | tr -s &#8216; &#8216; | cut -d &#8216; &#8216; -f5&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;ip&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \/sbin\/ifconfig | grep &#8216;&lt;inet&gt;&#8217; | sed -n &#8216;1p&#8217; | tr -s &#8216; &#8216; | cut -d &#8216; &#8216; -f3 | cut -d &#8216;:&#8217; -f2&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;mac&#8212;&#8212;&#8212;&#8212;&#8212;-ifconfig | grep HWaddr | awk -F&#8221; &#8221; &#8216;{print $5}&#8217;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;ip&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-ifconfig eth0 | [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","category-centos-6"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=378"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}