[root@Centos8 ~]# bash sysminfo.sh
My hostname is $Centos8.5
IP address is 10.0.0.150
OS version is CentOS Linux release 8.5.2111
Kernel version is 4.18.0-348.el8.x86_64
CPU type is Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
Memtotol is 1996812 kB
Disk space is 200G
#!/bin/bin
echo -e "My hostname is $`hostname`"
echo
echo -e "IP address is `ifconfig ens33 |grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}'|head -n1`"
echo
echo -e "OS version is `cat /etc/redhat-release`"
echo
echo -e "Kernel version is `uname -r`"
echo
echo -e "CPU type is `lscpu|grep "Model name" |cut -d: -f2 |tr -s " "`"
printf "\n"
echo -e "Memtotol is `cat /proc/meminfo |head -n1 |grep -Eo '[0-9]+.*'`"
echo
echo -e "Disk space is `lsblk |grep 'sda\>'|grep -Eo '[0-9]+[[:upper:]]'`"
~
~