Jump to content

Recommended Posts

Posted

<div class="KonaBody"><p>Need to know exactly when your Mac was last booted, put to sleep, or woke from sleep? You can get precise information directly from the command line, which can be invaluable for anything from <a href="http://osxdaily.com/category/troubleshooting/">troubleshooting</a> various Mac problems to scheduling scripts.</p>

<p><strong>Get Precise System Boot Time</strong>

<code>sysctl -a |grep kern.boottime</code>

The results will look something like this:</p>

<blockquote><p>kern.boottime = Mon Jul 4 08:00:42 2011</p></blockquote>

<p>If you’re looking for a <a href="http://osxdaily.com/2009/09/22/check-your-macs-uptime-and-reboot-history/">record of a Macs boot history</a>, try using the “last reboot” command instead. Similarly if you’re only looking to see <a href="http://osxdaily.com/2010/01/21/how-long-has-my-mac-been-on/">how long</a> a Mac has been powered on, you can use the simple “uptime” command, which will give you the lapsed time since last system boot.</p>

<p><strong>Get Mac System Sleep Time</strong>

<code>sysctl -a |grep sleeptime</code>

Resulting in something like:</p>

<blockquote><p>kern.sleeptime: { sec = 1310538756, usec = 323918 } Tue Jul 12 23:32:36 2011</p></blockquote>

<p><strong>Get Mac OS X System Wake Time</strong>

<code>sysctl -a |grep waketime</code>

Results will resemble this:</p>

<blockquote><p>kern.waketime: { sec = 1310573055, usec = 11 } Wed Jul 13 09:04:15 2011</p></blockquote>

<p>Don’t forget that you can also <a href="http://osxdaily.com/2010/07/17/why-mac-wakes-from-sleep/">find out why a Mac woke from sleep by reviewing system logs</a> and interpreting the reason codes.</p>

</div>

<p><a href="http://feedads.g.doubleclick.net/~a/eXXnL3mRPb1Hhznqn6H8ZClmiAE/0/da"><img src="http://feedads.g.doubleclick.net/~a/eXXnL3mRPb1Hhznqn6H8ZClmiAE/0/di" border="0" ismap="true"></img></a><br/>

<a href="http://feedads.g.doubleclick.net/~a/eXXnL3mRPb1Hhznqn6H8ZClmiAE/1/da"><img src="http://feedads.g.doubleclick.net/~a/eXXnL3mRPb1Hhznqn6H8ZClmiAE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">

<a href="http://feeds.feedburner.com/~ff/osxdaily?a=2MZ3SEQY4uk:NiC4S5BckcE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=2MZ3SEQY4uk:NiC4S5BckcE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=2MZ3SEQY4uk:NiC4S5BckcE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=2MZ3SEQY4uk:NiC4S5BckcE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=2MZ3SEQY4uk:NiC4S5BckcE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=2MZ3SEQY4uk:NiC4S5BckcE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=2MZ3SEQY4uk:NiC4S5BckcE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a>

</div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/2MZ3SEQY4uk" height="1" width="1"/>

 

View the full article

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic


×
×
  • Create New...