centos 查看脚本
#!/bin/bash
date >>info.txt
echo "本机centos版本为" >>info.txt
cat /etc/issue >>info.txt
cat /etc/redhat-release >>info.txt
rpm -q centos-release. >>info.txt
echo "本机centos 版本详细信息" >>info.txt
cat /proc/version >>info.txt
echo "本机centos为32位还是64位" >>info.txt
getconf LONG_BIT >>info.txt
echo "本机内核版本详细信息" >>info.txt
uname -a >>info.txt
echo "本机cpu名称" >>info.txt
more /proc/cpuinfo | grep "model name" >>info.txt
echo "本机cpu位数" >>info.txt
getconf LONG_BIT >>info.txt
echo "本机cpu逻辑个数" >>info.txt
cat /proc/cpuinfo | grep "processor" | wc -l >>info.txt
echo "本机cpu物理个数" >>info.txt
cat /proc/cpuinfo | grep "physicalph id" | sort | uniq | wc -l >>info.txt
echo "本机每个物理cpu的核数cores" >>info.txt
cat /proc/cpuinfo | grep "cpu cores" >>info.txt
getconf LONG_BIT >>info.txt
yum install dmidecode -y
echo "本机内存插槽数以及内存分别多大" >>info.txt
dmidecode|grep -P -A5 "Memory\s+Device"| grep Size | grep -v Range >>info.txt
echo "本机支持最大内存为" >>info.txt
dmidecode | grep -P ‘Maximum\s+Capacity‘ >>info.txt
echo "本机内存条的频率 备注:主板兼容内存频率,并非真实内存频率" >>info.txt
dmidecode | grep ‘Speed‘ >>info.txt
echo "本机硬盘分区情况" >>info.txt
lsblk >>info.txt
echo "本机硬盘使用情况" >>info.txt
df -h >>info.txt
yum install -y curl
echo "本机公网IP为" >>info.txt
curl icanhazip.com >>info.txt