如何通过脚本实现显示版本号、CPU、硬盘和内存条大小
COLOR="\033[1;$[RANDOM%7+31]m"
COLOR1="\033[1;$[RANDOM%7+31]m"
COLOR2="\033[1;$[RANDOM%7+31]m"
COLOR3="\033[1;$[RANDOM%7+31]m"
COLOR4="\033[1;$[RANDOM%7+31]m"
COLOREND="\033[0m"
echo -e "OS Verion is $COLOR`cat /etc/redhat-release`\033[0m"
echo -e "kernel version is $COLOR1`uname -r`\033[0m"
echo -e "CPU type is $COLOR2`lscpu|grep 'Model name'|cut -d: -f2|tr -s ' '`\033[0m"
echo -e "Disk space is $COLOR3`lsblk|grep disk|tr -s ' '|cut -d ' ' -f4`\033[0m"
echo -e "Memory size is $COLOR4`free -h|grep Mem|tr -s ' ' |cut -d" " -f2`\033[0m"
-------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------- 博客均为个人笔记,无所追求,仅供参考~~~ QQ--2382990774