标签:mac int pen random 生成 hex print dom linu
1.使用$RANDOM和md5sum
#echo $RANDOM | md5sum | sed ‘s/../&:/g‘ | cut -c1-17
2.使用openssl工具hex
[cqs@centos702 ~]$ openssl rand -hex 6 |sed ‘s/../&:/g;s/:$//‘
9f:13:48:c1:f2:8d
3.使用perl命令
[cqs@centos702 ~]$ perl -e ‘print join(":",map{sprintf "%0.2x",rand(256)}(1..6)), "\n"‘
38:7c:62:a3:9f:a0
标签:mac int pen random 生成 hex print dom linu
原文地址:https://blog.51cto.com/1929297/2417454