systemctl
是一个用于管理 systemd 系统和服务的命令行工具
systemctl list-units --type=service
sudo systemctl start<service_name>
sudo systemctl stop<service_name>
sudo systemctl restart<service_name>
systemctl status<service_name>
sudo systemctl enable<service_name>
sudo systemctl disable<service_name>
systemctl is-enabled<service_name>
sudo systemctl reload<service_name>
journalctl -u<service_name>
systemctl --failed
sudo systemctl reset-failed
这些是 systemctl
命令的一些常见用法。请注意,执行需要管理员权限的操作(如启动、停止或重启服务)时,需要使用 sudo
命令。