Linux last Reboot Time and Date Find Out Command

Server Uptime Command To Find Out How Long The System Has Been Running

UNIX / Linux uptime command

Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following commands:
[root@sujeet ~]# uptime
 11:10:46 up  1:15,  7 users,  load average: 0.30, 0.20, 0.11

The uptime command gives a one line display of the following information.
  • The current time (11:10:46)
  • How long the system has been running (up 1:15 hours)
  • How many users are currently logged on (7 user)
  • The system load averages for the past 1, 5, and 15 minutes (0.30, 0.20, 0.11)
This is the same information contained in the header line displayed by the w and top commands:
[root@sujeet ~]# w
 11:13:32 up  1:18,  7 users,  load average: 0.52, 0.35, 0.18
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     :0       -                15:12   ?xdm?   6:16   0.09s /usr/bin/gnome-
root     pts/1    :0.0             15:13     ?     0.03s  0.03s bash
root     pts/2    :3.0             15:15     ?     0.04s  0.03s bash
root     pts/3    :3.0             15:15     ?     1.42s  0.14s bash
root     pts/4    :3.0             15:51     ?     3:38  14.89s scp -r /u02/PRO
root     pts/5    :3.0             11:51   11:06   0.02s  0.02s bash
root     pts/6    192.168.1.3      11:10    0.00s  0.04s  0.02s w

[root@sujeet ~]# top

top - 11:14:21 up  1:19,  7 users,  load average: 0.47, 0.37, 0.19
Tasks: 424 total,   1 running, 423 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.2%sy,  0.0%ni, 99.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  47490168k total, 13322048k used, 34168120k free,   288916k buffers
Swap: 16777208k total,        0k used, 16777208k free, 10071952k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
14309 root      20   0 13020 1352  808 R  0.7  0.0   0:00.06 top
 4293 root      20   0  270m  15m  12m S  0.3  0.0   0:21.58 vmtoolsd
 4340 root      20   0 70376 2656 2048 S  0.3  0.0   0:00.72 escd
 4392 root      20   0 13064 1240  972 S  0.3  0.0   0:00.31 gam_server
 4842 root      20   0  271m  15m  12m S  0.3  0.0   0:13.48 vmtoolsd
 5057 root      20   0  283m  20m 9032 S  0.3  0.0   0:23.81 gnome-terminal
10885 applchin  20   0  669m  43m 7664 S  0.3  0.1   0:08.17 java


Server last Reboot time
who command
You need to use who command, to print who is logged on. It also displays the time of last system boot. Use last command to display system reboot and shutdown date and time.
[root@sujeet ~]# who -b
         system boot  2015-03-31 09:54

Use last command to display listing of last logged in users and system last reboot time and date:
[root@sujeet ~]# last reboot | less
reboot   system boot  2.6.32-300.10.1. Tue Mar 31 09:54          (01:21)
reboot   system boot  2.6.32-300.10.1. Sun Mar 29 02:15         (2+09:00)
reboot   system boot  2.6.32-300.10.1. Wed Mar 25 14:54         (3+11:19)
reboot   system boot  2.6.32-300.10.1. Wed Jan 28 11:19         (56+03:33)


[root@sujeet ~]# last reboot | head -1
reboot   system boot  2.6.32-300.10.1. Tue Mar 31 09:54          (01:24)

The last command searches back through the file /var/log/wtmp and displays a list of all users logged in (and out) since that file was created. The pseudo user reboot logs in each time the system is rebooted. Thus last reboot command will show a log of all reboots since the log file was created.

[root@sujeet ~]# last -x|grep shutdown | head -1
shutdown system down  2.6.32-300.10.1. Sun Mar 29 02:14 - 11:19 (2+09:05)

-x: Display the system shutdown entries and run level changes.

[root@sujeet ~]# cat /var/log/messages

Try the following commands:
Display list of last reboot entries: last reboot | less
Display list of last shutdown entries: last -x | less
or more precisely: last -x | grep shutdown | less
Some possible log files to explore: (found a Ubuntu system, but I would hope that they're present on most Linux/Unix systems)
/var/log/debug
/var/log/syslog (will be pretty full and may be harder to browse)
/var/log/user.log
/var/log/kern.log
/var/log/boot

No comments:

ORA-00059: Maximum Number Of DB_FILES Exceeded in 19C database

When I am adding datafile to my 19C database facing the below error. SQL> alter tablespace DATA  add datafile '/u01/data/data15.dbf...