将OUI部分过滤出来
egrep '^([A-F]|[0-9]){6}' oui_20200203.txt | awk '{print $1}' > oui_20200203_base_16.txt
差集,明确新增的OUI是哪些厂商
egrep `s=$(cat oui_20200203_base_16.txt oui_20200207_base_16.txt | sort | uniq -u | tr "\n" "|") && echo ${s%?}` oui_20200207.txt
分解如下:
求差集的命令
cat oui_20200203_base_16.txt oui_20200207_base_16.txt | sort | uniq -u
差集结果列转行,行中各列之间以 “|”分割
tr "\n" "|"
将转换为的定义为变量s
s=$(cat oui_20200203_base_16.txt oui_20200207_base_16.txt | sort | uniq -u | tr "\n" "|")
将变量s的最后一个字符去掉,这里是“|”
echo ${s%?}
过滤出来这些新增的OUI的厂商是哪些
命令如下
egrep `s=$(cat oui_20200203_base_16.txt oui_20200207_base_16.txt | sort | uniq -u | tr "\n" "|") && echo ${s%?}` oui_20200207.txt
结果如下
A8934A (base 16) CHONGQING FUGUI ELECTRONICS CO.,LTD.
A4056E (base 16) Tiinlab Corporation
C87B23 (base 16) Bose Corporation
78D9E9 (base 16) MOMENTUM IOT
5C625A (base 16) CANON INC.
7C0A3F (base 16) Samsung Electronics Co.,Ltd
08AA89 (base 16) zte corporation
04D60E (base 16) FUNAI ELECTRIC CO., LTD.
60577D (base 16) eero inc.
EC153D (base 16) Beijing Yaxunhongda Technology Co., Ltd.
D8A35C (base 16) Samsung Electronics Co.,Ltd
C09296 (base 16) zte corporation
50E24E (base 16) zte corporation
145AFC (base 16) Liteon Technology Corporation
34865D (base 16) Espressif Inc.
082CED (base 16) Technity Solutions Inc.
18BFB3 (base 16) Samsung Electronics Co., Ltd., Memory Division
042728 (base 16) Microsoft Corporation
2CC81B (base 16) Routerboard.com
ECB970 (base 16) Ruijie Networks Co.,LTD
308398 (base 16) Espressif Inc.
F889D2 (base 16) CLOUD NETWORK TECHNOLOGY SINGAPORE PTE. LTD.
1027F5 (base 16) TP-Link Corporation Limited
C4BCD7 (base 16) New Ryatek
C0AEFD (base 16) Shenzhen HC-WLAN Technology Co.,Ltd
DC87CB (base 16) Beijing Perfectek Technologies Co., Ltd.
60A4B7 (base 16) TP-Link Corporation Limited
38F3FB (base 16) Asperiq