读知识首页 >> 科技技术 >> 知识详情

查看linux启动的服务

2023-11-04

你可以使用以下命令来查看Linux启动的服务:

查看linux启动的服务

1. `systemctl list-units`:显示所有正在运行的服务。

2. `systemctl list-units --type=service`:显示所有正在运行的服务,只包括服务类型。

3. `systemctl list-unit-files`:显示所有可用的服务单元文件。

4. `systemctl list-unit-files --type=service`:显示所有可用的服务单元文件,只包括服务类型。

5. `systemctl status `:查看特定服务的状态。

6. `systemctl start `:启动某个服务。

7. `systemctl stop `:停止某个服务。

8. `systemctl restart `:重启某个服务。

9. `systemctl enable `:设置某个服务为开机自启动。

10. `systemctl disable `:取消某个服务的开机自启动。

请注意,在某些发行版上,这些命令可能会需要root权限才能执行,你可以使用`sudo`命令来提升权限。