当前位置:首页>Linux>Linux命令速查 -- 系统控制速查表

Linux命令速查 -- 系统控制速查表

  • 2026-10-06 20:38:07
Linux命令速查 -- 系统控制速查表

锁屏与解锁

锁定屏幕

dbus-send --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock

解锁屏幕

dbus-send --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SetActive boolean:false

重启系统

reboot           # 重启系统       shutdown -r      # 重启系统       systemctl reboot # 使用 systemd 重启系统

关机

poweroff           # 关闭电源              shutdown -h now    # 立即关机              reboot -p          # 关机(poweroff 模式) systemctl poweroff # 使用 systemd 关机     halt               # 停止系统   

定时关机

shutdown -h 18:45 "Server is going down for maintenance"
在指定时间(18:45)关机,并广播维护通知。

蓝牙服务控制

service bluetooth stop     # 停止蓝牙服务(传统方式)     systemctl stop bluetooth   # 停止蓝牙服务(systemd 方式) service bluetooth start    # 启动蓝牙服务(传统方式)     systemctl start bluetooth  # 启动蓝牙服务(systemd 方式) 

WiFi 服务控制

关闭 WiFi

nmcli nm wifi off

开启 WiFi

nmcli nm wifi on

显示器与电源管理

xset dpms force off  # 立即关闭显示器       systemctl suspend    # 挂起系统(睡眠)     pm-suspend           # 挂起系统(传统方式) systemctl hibernate  # 休眠系统   

服务管理

systemctl list-units --type=service  # 列出正在运行的服务   service --status-all                 # 列出所有服务状态     systemctl start [serviceName]        # 启动服务             service [serviceName] start          # 启动服务(传统方式) systemctl stop [serviceName]         # 停止服务             service [serviceName] stop           # 停止服务(传统方式) systemctl enable [serviceName]       # 设置服务开机自启     journalctl -u [serviceName]          # 查看服务日志     

最新文章

随机文章