systeminfo.sh脚本:
echo -e "hostname 主机名 " : `hostname`
echo -e "IPv4 address IPv4地址 :" `ifconfig ens33 | grep -Eo '([0-9]{1,3}.){3}[0-9]{1,3}'| head -n1`
echo -e "OS version 操作系统版本 :" `cat /etc/redhat-release`
echo -e "KernelVersion 内核版本:" `uname -r`
echo -e "CPU型号:" `lscpu|grep "^Model name" | tr -s " " | cut -d: -f2`
echo -e "Memery 内存大小 :" `cat /proc/meminfo | grep MemTotal`
echo -e "Diskspace 硬盘大小:" `lsblk | grep -E '^sda' | grep -Eo [0-9]+[[:upper:]]`