linux.sh

 

一.系统版本

     centos7.3

 

 

二.系统体检

 

#!/bin/bash
echo "系统内存大小:"
free -g |grep ‘Mem‘ |awk {print $2}
echo "系统cpu核数:"
lscpu |grep ‘^CPU(s):‘ |awk ‘{print $2}‘
cat /proc/cpuinfo | grep "physical id" |wc -l

 

 

 

三.系统初始化

 

#!/bin/bash
cp /etc/security/limits.conf    /etc/security/limits.conf.bak.install.glc
echo "# init by igoodful, 32cpu,128G memory" > /etc/security/limits.conf
echo "*       hard    nofile  300000" >> /etc/security/limits.conf
echo "*       soft    nofile  150000" >> /etc/security/limits.conf
echo "*       hard    nproc  3000000" >> /etc/security/limits.conf
echo "*       soft    nproc  1500000" >> /etc/security/limits.conf
echo "*       soft    core   unlimited" >> /etc/security/limits.conf

cp  /etc/sysctl.conf  /etc/sysctl.conf.bak.install.glc
echo "# init by igoodful 32cpu 128G memory" >  /etc/sysctl.conf
echo "" >>  /etc/sysctl.conf
echo "" >>  /etc/sysctl.conf
echo "" >>  /etc/sysctl.conf
echo "" >>  /etc/sysctl.conf
echo "" >>  /etc/sysctl.conf
echo "" >>  /etc/sysctl.conf

echo "" >>  /etc/sysctl.conf


 

linux.sh

上一篇:linux文件属性


下一篇:hdu 2187(贪心)