centos7使用命令行查看开机启动项和服务启动状态

查看开机启动项

systemctl list-unit-files
加粗样式

查看单个服务开机启动状态

第一种grep方法

systemctl list-unit-files | grep 服务名称

systemctl list-unit-files | grep ‘nginx’
systemctl list-unit-files | grep ‘smb’

在这里插入图片描述

第二种命令行

systemctl list-unit-files 服务名称.service

systemctl list-unit-files smb.service
systemctl list-unit-files nginx.service
systemctl list-unit-files mysqld.service

在这里插入图片描述

查看哪些为开机启动的服务

systemctl list-unit-files | grep enable

猜你喜欢

转载自blog.csdn.net/guo_qiangqiang/article/details/114166327