有没有命令可以告诉你,你打开 Ubuntu 多少次?例如,早上 8 点你打开 ubuntu,早上 10 点你输入该命令,结果是两个小时?
答案1
尝试uptime
命令,
$ uptime -s
2014-06-17 09:36:38
或者
$ uptime -p
up 10 hours, 12 minutes
从uptime --help
-p, --pretty show uptime in pretty format
-s, --since system up since
从man uptime
,
uptime gives a one line display of the following information. The cur‐
rent time, how long the system has been running, how many users are
currently logged on, and the system load averages for the past 1, 5,
and 15 minutes.
答案2
uptime
如果您只是想从终端了解它,您可以使用。
或者您可以使用系统监视器conky
将其永久显示在桌面上。