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-08-2013, 12:32 PM   #1
Quon
LQ Newbie
 
Registered: Nov 2011
Posts: 20

Rep: Reputation: 0
How can I tell how long my computer has been running, or at what time it booted last


I googled and found a command entitled uptime, which is supposed to tell me, but all it seems to tell is the current time (as you will see the time it returns changes as the current time changes).

Code:
root [ ~ ]# uptime
 12:56:26 up  1:16,  2 users,  load average: 0.70, 0.85, 1.11
root [ ~ ]# uptime
 12:58:08 up  1:17,  2 users,  load average: 1.09, 0.92, 1.10
root [ ~ ]# uptime
 12:58:18 up  1:18,  2 users,  load average: 1.07, 0.92, 1.10
root [ ~ ]# uptime
 12:58:19 up  1:18,  2 users,  load average: 1.07, 0.92, 1.10
root [ ~ ]# uptime
 12:58:21 up  1:18,  2 users,  load average: 1.07, 0.92, 1.10
root [ ~ ]# uptime
 13:08:22 up  1:28,  3 users,  load average: 0.86, 0.99, 1.05
root [ ~ ]#
Is there any other method of determining how long it has been since I powered on? (or getting that info from the uptime command?)

Last edited by Quon; 02-08-2013 at 12:34 PM.
 
Old 02-08-2013, 01:10 PM   #2
Habitual
Senior Member
 
Registered: Jan 2011
Location: Pelican Bay Correctional
Distribution: I can't wait for Linux to be 'underground' again.
Posts: 3,954
Blog Entries: 1

Rep: Reputation: Disabled
Code:
last reboot
who -b

Last edited by Habitual; 02-08-2013 at 01:13 PM.
 
2 members found this post helpful.
Old 02-08-2013, 01:31 PM   #3
rahulkya
Member
 
Registered: Feb 2009
Location: New Delhi
Distribution: Linux mint,Ubuntu,Debian,RHEL 5,slackware 13.1, free BSD,solaris.
Posts: 186
Blog Entries: 3

Rep: Reputation: 33
the uptime shows a rough value
Quote:
13:08:22 up 1:28, 3 users, load average: 0.86, 0.99, 1.05
here
Quote:
1:28
shows the time ..here its in hours
that means your system has been up from 1 hour 28 mins

Mine is
Quote:
rahul@rahul-Aspire-5742 ~ $ uptime
00:57:17 up 17 min, 2 users, load average: 0.27, 0.77, 0.47
So mine system uptime is 17 mins

Last edited by rahulkya; 02-08-2013 at 01:34 PM.
 
Old 02-08-2013, 01:31 PM   #4
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 3,644

Rep: Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320
uptime is already telling you that information in the 2nd column. The uptime was 1 hour and 16 minutes the first time you ran it, 1:28 the last time. On my machine:
Code:
$ uptime
 12:31:59 up 538 days, 23:01,  2 users,  load average: 0.01, 0.02, 0.00
It's been up for 538 days, 23 hours and 1 minute.

Last edited by suicidaleggroll; 02-08-2013 at 01:33 PM.
 
Old 02-09-2013, 04:05 PM   #5
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 421
Blog Entries: 28

Rep: Reputation: 2
And mine:
Code:
# uptime
 06:04:04 up 81 days, 10 min, load average: 0.27, 0.26, 0.20
is 81 days and 10 minutes.
There are many people that make linux machines server, and actually keep them ongoing, so uptime is a useful function.
Ted
 
Old 05-02-2013, 08:02 AM   #6
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 4,449

Rep: Reputation: 708Reputation: 708Reputation: 708Reputation: 708Reputation: 708Reputation: 708Reputation: 708
Quote:
Originally Posted by suicidaleggroll View Post
uptime is already telling you that information in the 2nd column. The uptime was 1 hour and 16 minutes the first time you ran it, 1:28 the last time. On my machine:
Code:
$ uptime
 12:31:59 up 538 days, 23:01,  2 users,  load average: 0.01, 0.02, 0.00
It's been up for 538 days, 23 hours and 1 minute.
no kernel update in the last 1.5 years ?

heres mine:
Code:
[schneidz@hyper ~]$ w
 09:01:24 up 112 days, 16:59,  4 users,  load average: 0.59, 0.55, 0.51
 
Old 05-02-2013, 09:03 AM   #7
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 3,644

Rep: Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320
Quote:
Originally Posted by schneidz View Post
no kernel update in the last 1.5 years ?
Old system, no internet access, only used for storage. Its OS is WAY past EOL.
 
Old 05-02-2013, 12:30 PM   #8
flirek
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Rep: Reputation: Disabled
Quote:
Is there any other method of determining how long it has been since I powered on? (or getting that info from the uptime command?)
try this:

cut -d" " -f1 /proc/uptime`

that is number of seconds since boot.
 
  


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
Hi to all. I am a long time Debian user, now running kubuntu montyxx12 LinuxQuestions.org Member Intro 3 12-25-2009 03:44 PM
Are kernel panics normal at reboot when servers been running for a long time? rjo98 Linux - Newbie 36 10-12-2009 03:50 PM
running any appli tooks a very long time abd_bela Debian 1 09-30-2009 10:53 PM
Help! My computer wont stay running. Shuts down after X amount of time. The_Nerd Linux - Hardware 10 04-07-2005 12:43 AM
rpmbuild rebuild running for long time littauer99 Linux - Newbie 1 11-28-2004 04:37 PM


All times are GMT -5. The time now is 11:57 AM.

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