FreeBSD system uptime how to
How to show the uptime
of a FreeBSD system? When was the last reboot? These questions are answered in this blog post. Sometimes you just want to know for how long your system has been running. FreeBSD provides some tools to get you this info. These are presented in this blog post.
Requirements
The following requirements have to be in place to be able to implement what is described in this post:
- an up to date FreeBSD version 11
Tools overview
FreeBSD has the following tools in its base system to provide information about how long the system has been running:
uptime
: show how long system has been runninglast
: show shutdown and boot timeswho
: show last system boot
uptime
The uptime
tool displays the current time, the length of time the system has been up, the number of users, and the load average of the system over the last 1, 5, and 15 minutes.
$ uptime 12:38PM up 7 days, 19:03, 1 users, load averages: 0.91, 0.84, 0.80
last
The last
utility can show shutdown and boot times of your system:
$ last reboot boot time Tue Jun 6 17:36 boot time Sun Jun 4 22:29 shutdown time Sun Jun 4 10:20 boot time Fri May 26 16:40 shutdown time Fri May 26 10:49 boot time Thu Apr 20 10:41 shutdown time Thu Apr 20 10:41 boot time Wed Apr 19 20:17 shutdown time Wed Apr 19 22:17 boot time Wed Apr 19 11:32 shutdown time Wed Apr 19 11:32 boot time Wed Apr 19 11:11 shutdown time Fri Apr 14 15:29 boot time Fri Apr 14 15:19 utx.log begins Fri Apr 14 15:19:37 CEST 2017
who
The who
utility can show the date and time of the last system reboot:
$ who -b system boot Jun 6 17:36
Resources
Some (other) resources about this subject: