linux的systemctl常用命令

本文详细介绍Systemd命令的使用方法,包括但不限于:显示系统状态、输出激活及执行失败的单元、查看已安装服务、激活和停止单元等。通过这些命令,用户可以有效地管理和维护Linux系统的运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

显示系统状态:
systemctl status

输出激活的单元
systemctl 或 systemctl list-units

输出执行失败的单元
systemctl --failed

查看全部已安装服务
systemctl list-unit-files

马上激活单元
systemctl start <单元>

马上停止单元
systemctl stop <单元>

重新启动单元
systemctl restart <单元>

又一次载入配置
systemctl reload <单元>

输出单元执行状态
systemctl status <单元>

检查单元是否配置为自己主动启动
systemctl is-enabled <单元>

开机自己主动激活单元
systemctl enable <单元>

取消开机自己主动激活单元
systemctl disable <单元>

禁用一个单元(禁用后,间接启动也是不可能的)
systemctl mask <单元>

取消禁用一个单元
systemctl unmask <单元>

显示单元的手冊页(必须由单元文件提供)
systemctl help <单元>

又一次载入 systemd,扫描新的或有变动的单元
systemctl daemon-reload

重新启动
systemctl reboot

退出系统并停止电源
systemctl poweroff

待机
systemctl suspend

休眠
systemctl hibernate

混合休眠模式(同一时候休眠到硬盘并待机)
systemctl hybrid-sleep

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值