是否有任何命令可以告诉您,您打开 Ubuntu 多少次?例如,在早上 8 点打开 ubuntu,在早上 10 点编写该命令,结果是两个小时?
尝试下uptime命令,
$ uptime -s
2014-06-17 09:36:38
Run Code Online (Sandbox Code Playgroud)
或者
$ uptime -p
up 10 hours, 12 minutes
Run Code Online (Sandbox Code Playgroud)
从 uptime --help
-p, --pretty show uptime in pretty format
-s, --since system up since
Run Code Online (Sandbox Code Playgroud)
从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.
Run Code Online (Sandbox Code Playgroud)