简单shell脚本之检测centos7基本环境
Posted 闭关苦炼内功
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了简单shell脚本之检测centos7基本环境相关的知识,希望对你有一定的参考价值。
个人开源镜像站站点下载
http://decs.pcl.ac.cn:3731/mirrors/software/Linux/shell/
http://decs.pcl.ac.cn:3731/mirrors/software/Linux/shell/check-centos7-base-env.sh
check-centos7-base-env.sh
#!/bin/bash
os()
{
echo "========== os-release =============="
cat /etc/os-release
}
arc()
{
echo "========== architecture =============="
arch
}
cpus()
{
echo "========== CPUs =============="
cat /proc/cpuinfo | grep "processor" |wc -l
}
mem()
{
echo "========== memory =============="
free -h
}
disk()
{
echo "========== disk =============="
df -hT
}
lang()
{
echo "========== system language environment =============="
echo $LANG
locale
#localectl set-locale LANG=en_US.UTF-8
#source /etc/locale.conf
#localedef -i en_US -f UTF-8 en_US.UTF-8
}
main()
{
os
arc
cpus
mem
disk
lang
}
main
chmod u+x check-centos7-base-env.sh
./check-centos7-base-env.sh
不喜勿喷,我们下期见,拜拜!
以上是关于简单shell脚本之检测centos7基本环境的主要内容,如果未能解决你的问题,请参考以下文章