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
命令。