sys-devices-platform-serial8250-serial8250:0-serial8250:0.0-tty-ttyS0.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.0/tty/ttyS0
sys-devices-platform-serial8250-serial8250:0-serial8250:0.1-tty-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.1/tty/ttyS1
sys-devices-platform-serial8250-serial8250:0-serial8250:0.10-tty-ttyS10.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.10/tty/ttyS10
sys-devices-platform-serial8250-serial8250:0-serial8250:0.11-tty-ttyS11.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.11/tty/ttyS11
sys-devices-platform-serial8250-serial8250:0-serial8250:0.12-tty-ttyS12.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.12/tty/ttyS12
sys-devices-platform-serial8250-serial8250:0-serial8250:0.13-tty-ttyS13.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.13/tty/ttyS13
sys-devices-platform-serial8250-serial8250:0-serial8250:0.14-tty-ttyS14.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.14/tty/ttyS14
sys-devices-platform-serial8250-serial8250:0-serial8250:0.15-tty-ttyS15.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.15/tty/ttyS15
sys-devices-platform-serial8250-serial8250:0-serial8250:0.16-tty-ttyS16.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.16/tty/ttyS16
sys-devices-platform-serial8250-serial8250:0-serial8250:0.17-tty-ttyS17.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.17/tty/ttyS17
sys-devices-platform-serial8250-serial8250:0-serial8250:0.18-tty-ttyS18.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.18/tty/ttyS18
sys-devices-platform-serial8250-serial8250:0-serial8250:0.19-tty-ttyS19.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.19/tty/ttyS19
sys-devices-platform-serial8250-serial8250:0-serial8250:0.2-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.2/tty/ttyS2
sys-devices-platform-serial8250-serial8250:0-serial8250:0.20-tty-ttyS20.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.20/tty/ttyS20
sys-devices-platform-serial8250-serial8250:0-serial8250:0.21-tty-ttyS21.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.21/tty/ttyS21
sys-devices-platform-serial8250-serial8250:0-serial8250:0.22-tty-ttyS22.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.22/tty/ttyS22
sys-devices-platform-serial8250-serial8250:0-serial8250:0.23-tty-ttyS23.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.23/tty/ttyS23
sys-devices-platform-serial8250-serial8250:0-serial8250:0.24-tty-ttyS24.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.24/tty/ttyS24
sys-devices-platform-serial8250-serial8250:0-serial8250:0.25-tty-ttyS25.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.25/tty/ttyS25
sys-devices-platform-serial8250-serial8250:0-serial8250:0.26-tty-ttyS26.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.26/tty/ttyS26
sys-devices-platform-serial8250-serial8250:0-serial8250:0.27-tty-ttyS27.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.27/tty/ttyS27
sys-devices-platform-serial8250-serial8250:0-serial8250:0.28-tty-ttyS28.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.28/tty/ttyS28
sys-devices-platform-serial8250-serial8250:0-serial8250:0.29-tty-ttyS29.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.29/tty/ttyS29
sys-devices-platform-serial8250-serial8250:0-serial8250:0.3-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.3/tty/ttyS3
sys-devices-platform-serial8250-serial8250:0-serial8250:0.30-tty-ttyS30.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.30/tty/ttyS30
sys-devices-platform-serial8250-serial8250:0-serial8250:0.31-tty-ttyS31.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.31/tty/ttyS31
sys-devices-platform-serial8250-serial8250:0-serial8250:0.4-tty-ttyS4.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.4/tty/ttyS4
sys-devices-platform-serial8250-serial8250:0-serial8250:0.5-tty-ttyS5.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.5/tty/ttyS5
sys-devices-platform-serial8250-serial8250:0-serial8250:0.6-tty-ttyS6.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.6/tty/ttyS6
sys-devices-platform-serial8250-serial8250:0-serial8250:0.7-tty-ttyS7.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.7/tty/ttyS7
sys-devices-platform-serial8250-serial8250:0-serial8250:0.8-tty-ttyS8.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.8/tty/ttyS8
sys-devices-platform-serial8250-serial8250:0-serial8250:0.9-tty-ttyS9.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/serial8250:0.9/tty/ttyS9
我运行systemctl list-units
后弹出了此内容。我不知道它们是什么,也不知道为什么有这么多。有人能告诉我这些是干什么的吗?
答案1
systemctl list-units
没有列出流程,而是列出了单位。
单位可能有或没有与其关联的流程。如果您选择一个单位,则可以sytemctl status
在该单位上运行并获取更多详细信息。
选择列表中的第一个项目,我得到了以下信息:
$ systemctl status sys-devices-platform-serial8250-serial8250:0-serial8250:0.0-tty-ttyS0.device
○ sys-devices-platform-serial8250-serial8250:0-serial8250:0.0-tty-ttyS0.device >
Loaded: loaded
Active: inactive (dead)
因此,此单元没有与之关联的进程。另外,请注意,单元名称以 结尾.device
。如果您读到man systemd.device
它,它会说这是一个“设备单元配置”。这种类型的单元可能永远不会有与之关联的进程。
在您的评论中,您说“没有连接这么多设备”。这并没有多大意义,因为 unix 中的设备可能对应于也可能不对应于物理设备,即使它们对应于物理设备,它们也可能对应于实际上未连接的潜在设备,但它们是连接此类设备时的占位符。
在这种情况下,所有设备都命名为 ttyS*,它们是硬件串行端口。现代 PC 通常在主板上有一个或两个这样的端口,尽管它们可能仅作为主板上的插槽存在,除非您添加该端口,否则它们在机箱外部没有实际连接。即使没有硬件,Linux 也始终为串行端口 0-31 创建设备。这只是串行设备驱动程序的一个功能,它在内核编译时静态分配设备,而不是在运行时动态分配设备。这些不会占用大量资源。
如果您想知道系统上有哪些进程,请使用该ps
命令。但当前正在运行的进程与“全新 Ubuntu 上”的进程仍然没有多大关系。
如果您想知道 systemd 了解您系统上的哪些服务,而不是list-units
列出 systemd 检测到的所有内容,您可能会发现这list-unit-files
更有用。但是,这会列出活动和非活动单元。您可以使用以下方法进一步缩小范围systemctl list-unit-files --state=enabled
如果你想知道当前 Ubuntu 系统上安装了哪些软件包,你可以使用以下命令获取列表dpkg -l
,也可以使用以下命令获取特定软件包的描述apt show packagename...