LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-30-2009, 01:00 AM   #1
gsiva
LQ Newbie
 
Registered: Apr 2007
Posts: 22

Rep: Reputation: 0
To find, how many times my box has rebooted


Hi,

Is there any command to find out how many times my box has been rebooted.
 
Old 05-30-2009, 01:19 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
I don't know of such a command. But you make it out from
/var/log/messages file.
 
Old 05-30-2009, 01:40 AM   #3
gsiva
LQ Newbie
 
Registered: Apr 2007
Posts: 22

Original Poster
Rep: Reputation: 0
Hi,

During the mean time, I did a search and find out with the command
tune2fs, with the option as -l

#tune2fs -l /dev/hda4

Note: /dev/hda4 may be any partition, but / partition is fine to go with .

Result:

Mount count: 4
 
Old 05-30-2009, 02:02 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can use
Code:
last reboot
If you're not rotating wtmp logs, it will show all the reboots, or else it will show show the reboots after the last log rotation.
 
Old 05-30-2009, 02:05 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,137

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
"last | grep -i "^reboot" | wc -l"
Might give you some idea.
 
Old 05-30-2009, 02:12 AM   #6
gsiva
LQ Newbie
 
Registered: Apr 2007
Posts: 22

Original Poster
Rep: Reputation: 0
Yes, last reboot is a best option, that too will show only if the wtmp file exists under the /var/log/, if not it will not show with the last reboot. I hope the result which I come out is a better one.

Thank for your update.

Please let me know if there could be any other options to go with.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find all files created or modified between 2 times MicahCarrick Linux - Software 3 06-29-2006 04:22 PM
how to find out when system rebooted in the last couple of days chromatech Linux - Software 2 06-13-2006 09:50 AM
Debian/Asterisk box eth0 going promisc odd times, rootkit scanned clean... JakeX Linux - Security 10 04-11-2006 01:40 PM
System hangs; Atheros Madwifi-ping times out every 15/16 times james 456 Linux - Networking 0 01-12-2006 06:55 PM
Slack box crashed seven times in last 24 hours jgams Linux - General 15 02-27-2005 11:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:10 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
Open Source Consulting | Domain Registration