在 Linux 上查看开机时间,可以使用以下两种方式:
1. uptime 命令
uptime 命令可以查看系统运行时间和平均负载信息。
在终端中输入 uptime 命令,将会显示如下信息:
```
$ uptime
17:04:12 up 2 days, 19:36, 1 user, load average: 0.05, 0.06, 0.00
```
其中,up 表示系统已经运行了多长时间,2 days 表示 2 天,19:36 表示 19 个小时 36 分钟,load average 则表示系统的平均负载信息。
2. last 命令
last 命令可以查看系统启动和关闭的记录,包括启动时间和运行时间。
在终端中输入 last reboot 命令,将会显示系统最近一次的启动记录,包括启动时间和运行时间:
```
$ last reboot
reboot system boot 5.4.0-89-generic Sat Oct 9 02:28 still running
reboot system boot 5.4.0-89-generic Thu Oct 7 06:16 - 01:47 (19:31)
reboot system boot 5.4.0-89-generic Tue Oct 5 08:01 - 06:16 (1+22:14)
reboot system boot 5.4.0-89-generic Sun Oct 3 00:44 - 08:01 (2+07:16)
reboot system boot 5.4.0-89-generic Fri Oct 1 12:38 - 00:44 (2+12:06)
wtmp begins Thu Sep 30 06:30:01 2021
```
其中,第一行记录了当前系统的启动时间和持续运行时间,还可以查看之前的启动记录。
以上两种方法都可以用来查看 Linux 系统开机的时间,选择一种适合自己的方式即可使用。