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 的开机启动状态