Centos6
#!/bin/bash
Yum Clean All
Yum Makecache | | Echo-e "\e[1;31m Please check the" This Yum source address is correct \e[0m "
# before the installation check
For I in $ (echo "man openssh-clients elinks lsof dstat sysstat vim");d O
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
This article is from the "Silence" blog, make sure to keep this source http://silencezone.blog.51cto.com/3613477/1882459
Linux System Basic Optimization