1.查看系统服务的状态
##列出当前系统服务的状态
systemctl list-units
systemctl list-units|grep httpd
systemctl list-units --type=service
systemctl list-units --all #包括没有找到配置文件的或者启动失败的服务
systemctl list-units --failed #列出所有加载失败的Unit
##列出服务的开机状态
systemctl list-unit-files
systemctl status sshd ##查看指定服务的状态
systemctl show sshd
##查看指定服务的倚赖关系
systemctl list-dependencies sshd
2. 服务启动、关闭、重启和重新加载
systemctl start httpd
systemctl start httpd.service
systemctl stop httpd
systemctl restart httpd
systemctl reload httpd # 重新加载配置
3. 开机启动
systemctl enable httpd
systemctl disable httpd
systemctl is-enabled httpd # 查看
systemctl --failed # 显示启动失败的服务
4. 系统管理
systemctl reboot
systemctl poweroff
# systemctl halt
# systemctl suspend
# systemctl hibernate
# systemctl hybrid-sleep
# systemctl rescue