美文网首页
systemctl 速记手册

systemctl 速记手册

作者: changhr2013 | 来源:发表于2024-09-19 15:43 被阅读0次

基本操作

启动服务

systemctl start service_name

停止服务

systemctl stop service_name

重启服务

systemctl restart service_name

重新加载服务配置

systemctl reload service_name

查看服务状态

systemctl status service_name

服务管理

启用服务(开机自启)

systemctl enable service_name

禁用服务(取消开机自启)

systemctl disable service_name

检查服务是否已启用

systemctl is-enabled service_name

查看所有已启用的服务

systemctl list-unit-files --state=enabled

系统管理

重启系统

systemctl reboot

关闭系统

systemctl poweroff

待机

systemctl suspend

休眠

systemctl hibernate

查看系统信息

查看系统启动时间

systemctl list-dependencies

查看系统启动耗时

systemctl list-dependencies --reverse

查看所有失败的服务

systemctl --failed

查看所有正在运行的服务

systemctl list-units --type=service --state=running

日志管理

查看服务日志

journalctl -u service_name

实时查看服务日志

journalctl -u service_name -f

查看指定时间段的日志

journalctl -u service_name --since "2023-01-01" --until "2023-01-02"

高级操作

编辑服务单元文件

systemctl edit service_name

重新加载 systemd 配置

systemctl daemon-reload

查看服务依赖关系

systemctl list-dependencies service_name

屏蔽服务(彻底禁用)

systemctl mask service_name

取消屏蔽服务

systemctl unmask service_name

请注意,某些命令可能需要 root 权限或使用 sudo 来执行。

相关文章

  • 中医针灸书单(免费阅读)

    点击书名看书籍详细内容 一,穴位 针灸经络穴位速记手册-黄泳.pdf 便携式针灸穴位记忆手册.pdf 图解针灸穴位...

  • systemd学习笔记

    systemctl 重启 systemctl reboot 关闭 systemctl poweroff CPU停止...

  • 5. linux命令

    来源: http://man.linuxde.net/systemctl systemctl systemctl命...

  • Basic knowledge about systemd an

    systemctl --help #查詢systemctl指令用法systemctl list-units #查詢...

  • CentOS7 Failed to start LSB: Bri

    systemctl stop NetworkManager systemctl disable NetworkMa...

  • systemctl

    重新加载配置文件 systemctl daemon-reload 启动 systemctl start redi...

  • systemctl

    图形界面及命令行界面 设置开机默认界面为图形界面 设置开机默认界面为命令行界面 开机重启即可生效,当然也可不重启切...

  • systemctl

    centos 7 关闭防火墙: systemctl stop firewalld.service #停止firew...

  • systemctl

    systemctl相当于service和chkconfig的结合体,使用它可以永久性启用/禁止或临时关闭/启动某个...

  • systemctl

    systemctl(system control)-控制systemd系统和服务管理器。 描述: 向system ...

网友评论

      本文标题:systemctl 速记手册

      本文链接:https://www.haomeiwen.com/subject/tmgoljtx.html