Q. I'd like to monitor my UNIX / Linux server reboot / shutdown usage. How do I get more information about reboot and shutdown command?
A. There is a file called /var/log/wtmp. The pseudo user reboot logs in each time the system is rebooted. Thus last reboot will show a log of all reboots since the log file was created.
wtmp also contains information about reboots and shutdowns, you can list that information, by typing the following command at the shell prompt:
$ sudo last reboot
OR
# last reboot
Output:
reboot system boot 2.6.22-14-generi Wed Oct 24 08:03 - 08:48 (00:44) reboot system boot 2.6.22-14-generi Tue Oct 23 21:21 - 00:40 (03:18) reboot system boot 2.6.22-14-generi Tue Oct 23 14:29 - 19:55 (05:26) reboot system boot 2.6.22-14-generi Mon Oct 22 18:36 - 19:55 (1+01:19) reboot system boot 2.6.22-14-generi Mon Oct 22 17:05 - 19:55 (1+02:50) reboot system boot 2.6.22-14-generi Mon Oct 22 14:50 - 17:03 (02:13) reboot system boot 2.6.22-14-generi Mon Oct 22 13:28 - 13:29 (00:01) reboot system boot 2.6.22-14-generi Mon Oct 22 13:07 - 13:27 (00:20) reboot system boot 2.6.22-14-generi Sun Oct 21 14:38 - 08:20 (17:42) reboot system boot 2.6.22-14-generi Sat Oct 20 10:53 - 12:54 (1+02:00) reboot system boot 2.6.22-14-generi Fri Oct 19 21:18 - 01:41 (04:22) reboot system boot 2.6.22-14-generi Fri Oct 19 16:07 - 01:41 (09:34) reboot system boot 2.6.22-14-generi Thu Oct 18 22:56 - 12:32 (13:35) reboot system boot 2.6.22-14-generi Thu Oct 18 14:30 - 12:32 (22:01)
You can also type the following command to get halt / shutdown time only:
$ last -x | grep down
Output:
vivek tty1 Mon Oct 22 13:25 - down (00:01) vivek tty7 :0 Mon Oct 22 13:08 - down (00:19) vivek tty1 Thu Oct 18 14:25 - down (00:04) vivek tty7 :0 Thu Oct 18 14:24 - down (00:04) vivek tty1 Thu Oct 18 14:16 - down (00:00) vivek tty1 Thu Oct 18 14:13 - down (00:02)
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 0 comments… add one now }