실행 중인 가상 머신에 있는 모든 네트워크 카드의 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