linux 系统基本优化
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 系统基本优化相关的知识,希望对你有一定的参考价值。
centos6
#!/bin/bash
yum clean all
yum makecache || echo -e "\e[1;31m Please check that the yum source address is correct \e[0m"
# Before the installation check
for i in $(echo "man openssh-clients elinks lsof dstat sysstat vim");do
service_packages=$(rpm -qa |grep "^"$i"-[0-9]")
if [ $? == 0 ];then
echo -e "\e[1;32m $service_packages is installed!\e[0m"
else
echo -e "\e[1;31m $i is not installed!,In the installing,Please wait.\e[0m"
yum install $i -y > /dev/null 2>&1
fi
done
grep "nofile 65535" /etc/security/limits.conf || echo "* - nofile 65535" >>/etc/security/limits.conf
grep ignorespace /etc/profile.d/history.sh ||echo "export HISTCONTROL=ignorespace" >> /etc/profile.d/history.sh; source /etc/profile.d/history.sh
grep "export HISTTIMEFORMAT" /etc/profile.d/history.sh ||echo ‘export HISTTIMEFORMAT="%F-%T "‘ >>/etc/profile.d/history.sh
本文出自 “silence” 博客,请务必保留此出处http://silencezone.blog.51cto.com/3613477/1882459
以上是关于linux 系统基本优化的主要内容,如果未能解决你的问题,请参考以下文章