実行中の仮想マシンのすべてのネットワークカードのMACアドレスのみを表示する方法を知りたいです。
これまで私はこれを持っています:
ipcopv2
-----------------------------------------------
Groups: /Infraestructura
State: powered off (since 2018-03-16T13:30:56.389000000)
NIC 1: MAC: 080027D40320, Attachment: Bridged Interface 'eth1.15', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 2: MAC: 080027660656, Attachment: Bridged Interface 'eth1', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 3: MAC: 0800270D3D9E, Attachment: Bridged Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
Capture screens: 0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
私はこれが欲しい:
ipcopv2
-----------------------------------------------
Groups: /Infraestructura
State: powered off (since 2018-03-16T13:30:56.389000000)
NIC 1: MAC: 080027D40320, Attachment: Bridged Interface 'eth1.15', Cable connected: on
NIC 2: MAC: 080027660656, Attachment: Bridged Interface 'eth1', Cable connected: on
NIC 3: MAC: 0800270D3D9E, Attachment: Bridged Interface 'eth0', Cable connected: on
Capture screens: 0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
どうすればいいですか? bashだけを使って情報を読み、その部分を表示する方法を理解したいと思います。
答え1
これはトリックを行うようです
$ ip link | awk '/link/ { print $2 }'
00:00:00:00:00:00
00:20:78:1c:xx:yy
00:1d:92:67:xx:yy