centos7如何查看服务状态

lewis 2019-05-24 20次阅读

在CentOS 7中,您可以使用systemctl命令来查看服务的状态。以下是一些常用的systemctl命令:

  1. 查看所有服务的状态:
systemctl list-units --type=service
  1. 查看特定服务的状态:
systemctl status <service_name>

例如,要查看Apache服务的状态,您可以运行:

systemctl status httpd
  1. 查看所有正在运行的服务:
systemctl list-units --type=service --state=running
  1. 查看所有已停止的服务:
systemctl list-units --type=service --state=inactive

请注意,要运行这些命令,您需要具有root或sudo权限。



发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。