自学内容网 自学内容网

微知-如何通过systemctl查看是否存在某个服务?如何全局查看所有的服务?(systemctl list-units --type=service, )

背景

本文介绍在某些场景需要查看是否启动某个服务,

命令

可以全局服务查看:(常用在记不清命令名字,只能记住片段)

systemctl list-units --type=service | grep rsh

也可以直接查看

systemctl status rshim
或者:
systemctl status rshim.service

注意这里的rshim系统或自动添加.service后缀,并且这里要写全。

实战:

查看某个服务
在这里插入图片描述

查看全局服务:
在这里插入图片描述


原文地址:https://blog.csdn.net/essencelite/article/details/142771355

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!