chkcongfig 查看开机自启动服务的命令

LANG=en

for yxw in

`chkconfig --list |grep "5:on"|grep -Ev "sshd|crond"|awk "{print $1}"`;

do chkconfig $yxw off 5;    ///5指应用级别

done

chkconfig --list  sshd 

chkconfig --level  3  sshd  on  开启运行级别3的sshd服务

chkconfig --level  245  sshd  off

 -r  内容自动转义   其中上方的(.*)代表任意字符串, 1  表示匹配前面的(.*)

原文地址:https://www.cnblogs.com/todayORtomorrow/p/10431606.html