显示Linux系统上的服务

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

init 和 systemd 都是 Linux的 init 守护进程systemd出现较晚最近的 Linux 发行版中很常用。init 使用service命令管理服务而Systemd用systemctl命令管理服务。init 和 systemd 都是 Linux的 init 守护进程即使你的 Linux 系统使用 systemd它仍然可以使用service命令这是因为service命令实际上已重定向到systemctlsystemd 向后兼容。

linux列出服务命令

service --status-all  #前面的[ – ]代表禁用[ + ]代表启用。

在这里插入图片描述

systemctl --all #显示所有加载的单位/属性包括死的/空的
systemctl list-unit-files #显示已安装的所有服务此命令将输出所有服务的状态。服务状态有启用enabled、禁用disabled、屏蔽masked在取消屏蔽之前处于非活动状态、静态static和已生成generated。

在这里插入图片描述

systemctl --type service list-unit-files #只查看服务类型的开机启动

在这里插入图片描述

sudo systemctl |grep running #查看正在运行的服务

在这里插入图片描述

service --status-all

在这里插入图片描述

systemctl其他使用

systemctl reboot # 重启系统
systemctl poweroff # 关闭系统切断电源
systemctl halt # CPU停止工作
systemctl suspend # 暂停系统
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: linux