shell获取mac地址
2015-06-04 12:28
501 查看
http://blog.csdn.net/shaobingj126/article/details/7376737
可用使用
#读取服务器的MAC地址
MAC=$(ifconfig eth0|grep eth0|awk '{print $5}')
#读取服务器的硬件序列号
hdparm -I /dev/sda > /hdSerial.txt
hdSer=$(grep \\"Serial Number" hdSerial.txt)
SER=$(echo ${hdSer#*:})
可用使用
#读取服务器的MAC地址
MAC=$(ifconfig eth0|grep eth0|awk '{print $5}')
#读取服务器的硬件序列号
hdparm -I /dev/sda > /hdSerial.txt
hdSer=$(grep \\"Serial Number" hdSerial.txt)
SER=$(echo ${hdSer#*:})
相关文章推荐
- unbuntu运行shell脚本的问题
- Linux C下的shell命令调用
- shell退出后 后台进程关闭的原因
- 用PowerShell处理复杂Json数据
- 如何在Bash Shell脚本中显示对话框
- powershell 枚举远程主机登录会话 [PowerQuinsta]
- [Erlang]Shell中数据对齐输出
- -bash-3.00$的解决方法
- PowerShell中的Json数据转换cmdlets
- Shell 简单的WEB命令
- use dict in bash
- bash shell 常用特殊字符
- bash 6-10
- linux下 /etc/profile、~/.bash_profile ~/.profile的执行过程 .
- .bash_profile和.bashrc的区别(如何设置生效)
- shell 文件
- 使用PowerShell收集客户端MAC地址
- shell脚本编程基础
- Shell 常用文本处理命令
- 自动下载源码_并编译_打包_部署_重启服务的Shell脚本