linux系统关闭不需要的服务

chkconfig --list |grep 3:on |awk '{print $1}' |egrep -v 'iptables|acpid|autofs|sshd|network|syslog|crond|yum-updatesd' |xargs -i{} chkconfig --level 3 {} off



只保留iptables|acpid|autofs|sshd|network|syslog|crond|yum-updatesd 服务