Friday, December 21, 2012

Unix/Linux:View system uptime/boottime (Applicable for standalone/server systems)

To view the system's boot time

Want to know at what time was your system booted.Use this command

 $ who -b

A sample output of this command will be something like this
          system boot  2012-12-21 16:21

The output tells you that the system was booted on 21st December 2012 at 16:21 (4:21 pm)

To view the system's uptime

View the system's uptime using this command


 A sample output of this command will be something like this
  17:11:41 up 50 min,  2 users,  load average: 0.25, 0.16, 0.14

uptime gives a one line display of the following information.The current 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.

System load averages is the average number of processes that are either in a runnable or uninterruptable state.A process in a runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for disk.The averages are taken over the three time intervals.Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time.(Source:Ubuntu man page)

 View System's boot/reboot history

To view a system's boot/reboot information for a period of time use this command

$ last -b

 Last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created.

 -f file
              Tells last to use a specific file instead of /var/log/wtmp.

               This is a count telling last how many lines to show.

   -n num
               The same.

Display the state of logins as of the specified time.  This is useful, e.g., to determine easily who was logged in at a particular time -- specify that time with -t and look for "still logged in".

More coming up tomorrow...


1 comment:

mahasiswa teladan said...

hi..Im college student, thanks for sharing :)