服务的启动与停止 命令格式:systemctl 选项 服务名 选项说明: start:启动;stop:停止;restart:重启;status:服务状态 服务名:一般以“.service”结尾,输入服务名时了可省略。
使用 ntsysv 命令设置服务的自启动 命令格式:ntsysv [--back][--level] ntsysv 图形化设置开机自动启动 空格选中是否启动 tab键切换按钮 选项说明:back,在互动界面不显示 cancel;level,在指定的运行级别中设置服务的自启动。 使用 systemctl 命令设置服务的自启动 查看服务的自启动状态:systemctl is-enabled [服务名称] 开启服务的自启动:systemctl enable 服务名称 关闭服务的自启动:systemctl disable 服务名称
查看所有的服务 命令格式:systemctl [选项] [–type=type] [–all] 选项说明: list-units:依据 unit 列出所有启动的 unit。加上–all 会列出没启动的 unit; list-unit-files:依据/usr/lib/systemd/system/ 内的启动文件,列出启动文件列表 –type=type: 为 unit type, 主要有 service, socket, target #systemctl //列出所有的系统服务 #systemctl list-units //列出所有启动 unit #systemctl list-unit-files //列出所有启动文件 #systemctl list-units -type=service -all //列出所有 service 类型的 unit #systemctl list-units -type=service -all grep cpu //列出 cpu 电源管理机制的服务 #systemctl list-units -type=target -all //列出所有目标单元 target
systemctl poweroff 系统关机 systemctl reboot 重新启动 systemctl suspend 进入睡眠模式 systemctl hibernate 进入休眠模式 systemctl rescue 强制进入救援模式 systemctl emergency 强制进入紧急救援模式
如对本文有疑问, 点击进行留言回复!!
linux下文本编辑器vim的使用方法(复制、粘贴、替换、行号、撤销、多文件操作)
网友评论