LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-03-2014, 01:05 AM   #1
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Rep: Reputation: Disabled
want to know about "last" command


Code:
reboot   system boot  2.6.32-358.el6.x Mon Feb  3 09:27 - 11:32  (02:05)
what does the above line say.
 
Old 02-03-2014, 01:31 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
This line says about the last reboot of your system and this output was possibly generated using cmd last reboot. However, as last commands's manual says, it gives a list of last logged in users. Moreover, by using cmd line options, other info. can also be retrieved. Check out man page.
 
Old 02-03-2014, 01:36 AM   #3
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
This line says about the last reboot of your system and this output was possibly generated using cmd last reboot. However, as last commands's manual says, it gives a list of last logged in users. Moreover, by using cmd line options, other info. can also be retrieved. Check out man page.
How to know when it came up?
 
Old 02-03-2014, 01:45 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Explain your question little more and before asking, mention that what cmd you had invoked which producted above result? However, to know last reboot time, you can try following cmds:
Code:
user@system~$ who -b
OR
user@system~$ last reboot | head -1
Also, check out last cmd main page for detailed info.

Last edited by shivaa; 02-03-2014 at 01:47 AM.
 
Old 02-03-2014, 01:48 AM   #5
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
Explain your question little more and before asking, mention that what cmd you had invoked which producted above result? However, to know last reboot time, you can try following cmds:
Code:
~$ who -b
~$ last reboot | head -1
Also, check out last cmd main page for detailed info.
Sorry for inconveninence. My senior told me that this server restarted at 9:27. find the reason for that.

I want to know when it was down and at what time it came up. and reason for that. and how it was done automatically.
 
Old 02-03-2014, 02:08 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Alright, in that case you should check system logs on that particular time. You can check under /var/log/messages. BTW, which system/OS it is?
 
Old 02-03-2014, 02:11 AM   #7
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
Alright, in that case you should check system logs on that particular time. You can check under /var/log/messages. BTW, which system/OS it is?
It is CentOS 6. I think in /var/log/messages, i will not get anything because i think it was rebooted by tripping the ups. What should i try to find the answers asked by me in previous section.

I have added output of last command.
Quote:
Quote:
root pts/0 gaidl-5001.gai.n Mon Feb 3 09:30:56 2014 - Mon Feb 3 09:33:35 2014 (00:02)
reboot system boot 2.6.32-358.el6.x Mon Feb 3 09:27:37 2014 - Mon Feb 3 12:42:47 2014 (03:15)
root pts/6 192.168.50.3 Sat Feb 1 22:29:07 2014 - down (00:01)
root pts/5 192.168.3.4 Sat Feb 1 22:29:07 2014 - down (00:01)
root pts/3 192.168.3.4 Sat Feb 1 22:18:52 2014 - down (00:11)
root pts/2 192.168.3.4 Sat Feb 1 22:13:39 2014 - down (00:16)
root pts/3 192.168.3.4 Sat Feb 1 19:29:42 2014 - Sat Feb 1 20:17:05 2014 (00:47)
root pts/2 192.168.3.4 Sat Feb 1 18:37:05 2014 - Sat Feb 1 22:12:51 2014 (03:35)
root pts/2 gaidl-5001.gai.n Sat Feb 1 18:18:24 2014 - Sat Feb 1 18:19:11 2014 (00:00)
root pts/4 192.168.3.4 Sat Feb 1 18:16:01 2014 - Sat Feb 1 22:13:41 2014 (03:57)

Last edited by sachin.davra; 02-03-2014 at 02:14 AM.
 
Old 02-03-2014, 03:45 AM   #8
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by sachin.davra View Post
I think in /var/log/messages, i will not get anything because i think it was rebooted by tripping the ups.
First thing, last cmd can give you the reboot time, but not it's reason.
Second, how can you say that you won't get anything in /var/log/messages?
Did you check other log files like /var/log/syslog or cmd like dmesg?
On the other hand, when you know the reason for reboot (tripping the ups), then why you need to find it in log files?
Also, did you read manual of last cmd and analyzed log files?

I guess, your senior wants you to learn things instead of asking people to give you a readymade solution. So, as said, before asking same thing again and again, read man pages and log files or dig over Internet. It will help you.
 
Old 02-03-2014, 04:01 AM   #9
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shivaa View Post
First thing, last cmd can give you the reboot time, but not it's reason.
Second, how can you say that you won't get anything in /var/log/messages?
Did you check other log files like /var/log/syslog or cmd like dmesg?
On the other hand, when you know the reason for reboot (tripping the ups), then why you need to find it in log files?
Also, did you read manual of last cmd and analyzed log files?

I guess, your senior wants you to learn things instead of asking people to give you a readymade solution. So, as said, before asking same thing again and again, read man pages and log files or dig over Internet. It will help you.
In /var/log/messages i got only
Code:
Feb  1 23:46:25 localhost kernel: type=1305 audit(1391278585.393:56542): audit_pid=0 old=3043 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditd_t:s0 res=1
Feb  1 23:46:25 localhost kernel: type=1305 audit(1391278585.495:56543): audit_enabled=0 old=1 auid=4294967295 ses=4294967295 subj=system_u:system_r:auditctl_t:s0 res=
1
Feb  1 23:46:25 localhost kernel: Kernel logging (proc) stopped.
Feb  1 23:46:25 localhost rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="2508" x-info="http://www.rsyslog.com"] exiting on signal 15.
Feb  3 09:27:43 localhost kernel: imklog 5.8.10, log source = /proc/kmsg started.
Feb  3 09:27:43 localhost rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="2514" x-info="http://www.rsyslog.com"] start
syslog is not configured here. i think that's why i did not find /var/log/syslog file.
In dmesg how can i be sure about the problem because it builts when system boots. and it doesn't show the timing also.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos Server Failed @ Bootup: Missing "/sbin/blkid" & "fsck" command not found beagle7 Linux - Newbie 4 08-24-2012 02:33 AM
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 08:54 AM
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 05:23 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 04:28 PM


All times are GMT -5. The time now is 06:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration