个人Blog: hhktony.com
全部博文(553)
分类: LINUX
2011-12-02 10:27:36
其次,在生成的目录下面有一个info.xls文件,该文件是将硬件信息保存成了表格的形式。
" >>hardinfo.html
echo "
" >>hardinfo.html echo "">>hardinfo.html echo "硬件类别">>hardinfo.html echo "">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "">>hardinfo.html echo "硬件信息">>hardinfo.html echo "">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "">>hardinfo.html echo "ID">>hardinfo.html echo "">>hardinfo.html echo " | " >>hardinfo.html|
" >>hardinfo.html echo "CPU信息">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `cat /proc/cpuinfo |grep -w 'model name'|awk -F: '{print $2}'|uniq`>>hardinfo.html echo " | " >>hardinfo.html||
" >>hardinfo.html echo "内存">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `dmidecode -t memory |grep -5 "Memory Device"|grep -i "MB"|grep -i "size"|awk '{print $2,$3}'` >>hardinfo.html echo " | " >>hardinfo.html||
" >>hardinfo.html echo "北桥">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci |grep "00:00.0"|awk -F: '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci -n|grep \`lspci |grep "00:00.0"|awk '{print $1}'\`|awk '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html|
" >>hardinfo.html echo "南桥">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo " ">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "">>hardinfo.html echo " | " >>hardinfo.html|
" >>hardinfo.html echo "显卡">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci |grep "VGA"|awk -F: '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci -n|grep \`lspci |grep "VGA"|awk '{print $1}'\`|awk '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "There is no Video card">>hardinfo.html echo " | " >>hardinfo.html
" >>hardinfo.html echo "声卡">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci |grep "Audio"|awk -F: '{print $3}'`>>hardinfo.html # echo `lspci |grep \`lspci -n |awk 'match($2,"0403"){print $1,$3}'|awk '{print $1}'\`|awk -F: '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci -n|grep "\`lspci |grep "Audio"|awk '{print $1}'\`"|awk '{print $3}'`>>hardinfo.html # echo `lspci -n |awk 'match($2,"0403"){print $1,$3}'|awk '{print $2}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "There is no Audio card">>hardinfo.html echo " | " >>hardinfo.html
" >>hardinfo.html echo "网卡">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci |grep "Ethernet"|awk -F: '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci -n|grep \`lspci |grep "Ethernet"|awk '{print $1}'\`|awk '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "There is no NIC card">>hardinfo.html echo " | " >>hardinfo.html
" >>hardinfo.html echo "硬盘">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo -n `hdparm -I /dev/sda |grep "Model Number"|awk -F: '{printf $2}'`>>hardinfo.html echo `hdparm -I /dev/sda |grep "size"|grep GB|awk '{print $9,$10}'`>>hardinfo.html echo " | " >>hardinfo.html||
" >>hardinfo.html echo "光驱">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo -n `hdparm -I /dev/cdrom |grep "Model Number"`|awk -F: '{print $2}'>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "There is no CD-ROM">>hardinfo.html echo " | " >>hardinfo.html|
" >>hardinfo.html echo "无线网卡">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci |grep "Network"|awk -F: '{print $3}'` >> hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `lspci -n|grep \`lspci |grep "Network"|awk '{print $1}'\`|awk '{print $3}'`>>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "There is no wireless card">>hardinfo.html echo " | " >>hardinfo.html
" >>hardinfo.html echo "BIOS信息">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo -e "`dmidecode -s bios-version`\t" "`dmidecode -s bios-release-date`">> hardinfo.html echo " | " >>hardinfo.html||
" >>hardinfo.html echo "Modem ">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo `cat \`grep -l "Modem Function Group:" /proc/asound/card*/codec#* \`|grep "Vendor Id:"` >>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "There is no Modem">>hardinfo.html echo " | " >>hardinfo.html|
" >>hardinfo.html echo "Bluetooth">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "Support" >>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo "There is no Bluetooth">>hardinfo.html echo " | " >>hardinfo.html|
" >>hardinfo.html echo "其它硬件">>hardinfo.html echo " | " >>hardinfo.html" >>hardinfo.html echo -e "Cellular: \t">>hardinfo.html echo " ">>hardinfo.html echo -e "Camera: \t">>hardinfo.html echo " ">>hardinfo.html echo -e "Cardreader: \t">> hardinfo.html echo " | " >>hardinfo.html
firefox `pwd`/hardinfo.html &
SLA:http://hi.baidu.com/kangliang2008/blog/item/f13c1583927761ae0cf4d2b2.html