如果呢你知道系统服务名称,要看状态很简单:
bash
systemctl status server-name
比如
bash
systemctl status nginx
systemctl status redis
# 等
这是一个nginx的示例:

那问题是 当你不知道服务名称时该怎么办。举个例子,比如mysql在启动的时候,是以mysqld为名称启动的。这时候我们要先找到相应的服务名称。以下都以mysql为例
首先 得先确定你已经安装了。。
如果你有rpm 可以用这个:
bash
rpm -qa | grep -i mysql

如果没有rpm服务就算了 也没必要装个rpm。
重点来了,找服务列表:
bash
systemctl list-units --type=service | grep -i mysql

可以看到 这个服务叫 mysqld.service

这样 就能查询相应的状态了。redis nginx等等也同理