垃圾站 VPS技术 Centos7如何查看自启动列表systemctl list-unit-files以及设置服务自启动

Centos7如何查看自启动列表systemctl list-unit-files以及设置服务自启动

CentOS7查看自启列表命令

systemctl list-unit-files

Centos7如何查看自启动列表systemctl list-unit-files以及设置服务自启动插图

执行结果:”enabled:自启动”,”disabled:未自启动”

只查看服务类型的开机启动

systemctl --type service list-unit-files

重启或者查看某个服务状态

systemctl restart abrtd.service systemctl status abrtd.service

设置服务开机启动

systemctl enable nginx.service //设置nginx开机启动
systemctl enable php-fpm.service//php-fpm开机启动

搜索指定状态的服务

systemctl list-unit-files | grep enabled//搜索全部已启动的服务,enabled 启用;disabled 禁用。

搜索指定服务的状态

systemctl list-unit-files | grep nginx//搜索 nginx 的开机启动状态
上一篇
下一篇
联系我们

联系我们

返回顶部