`
coolerbaosi
  • 浏览: 728575 次
文章分类
社区版块
存档分类
最新评论

How to get linux running time

 
阅读更多
How to get linux running time
1.Use command "uptime"
It will output like this:
17:11:40 up 60 days, 4:11, 1 users, load average: 0.00, 0.01, 0.00
Which means it runs 60 days

2.Get from file /proc/uptime
cat /proc/uptime
It will output like this:
5227796.94 565899.85
The first number 5227796.94 means the system running seconds. We can use the command "date" to count the system running date and time:
date -d "$(awk -F. '{print $1}' /proc/uptime) second ago" +"%Y-%m-%d %H:%M:%S"
It will output like this:
2008-11-09 11:50:31

Which means the server when to run.

本文出自:冯立彬的博客






分享到:
评论

相关推荐

    Linux Bible 8th Edition

    More than 50 percent new and revised content for today's Linux environment gets you up and running in no time! Linux continues to be an excellent, low-cost alternative to expensive operating systems. ...

    Linux: Powerful Server Administration

    security and flexibility advantages.This Learning Path will teach you how to get up and running with three of the most popular Linux server distros: Ubuntu Server, CentOS 7 Server, and RHEL 7 Server....

    Beginning Ubuntu Linux Part1

    This time, the emphasis is on giving you the skills you need to keep your system running smoothly. You’ll learn how to install software, manage users, optimize your system, back up essential data, ...

    Beginning Ubuntu Linux Part2

    This time, the emphasis is on giving you the skills you need to keep your system running smoothly. You’ll learn how to install software, manage users, optimize your system, back up essential data, ...

    LINUX教程————[Wiley.Linux.Bible.2010.Edition].Christopher.Negus.

    Plus, you'll discover how to set up secure, fully functioning Linux server systems and get up-to-date installation advice. Topics Covered: * Getting off the Ground with Linux * Running a Linux ...

    Rails for .NET Developers (Facets of Ruby)

    we'll help you get up and running as a Ruby on Rails developer on any operating system: Windows, Mac, or Linux. We start with a gentle introduction to the object-oriented Ruby language with examples ...

    Packt.Python.Journey.from.Novice.to.Expert.2016

    Get Python up and running on Windows, Mac, and Linux in no time Grasp the fundamental concepts of coding, along with the basics of data structures and control flow Understand when to use the ...

    UE(官方下载)

    How to check your JavaScript source code for common mistakes without actually running the script or opening the web page Character properties at your fingertips Access the properties of a character ...

    Learning.Hadoop.2

    The last part of this book discusses the likely future direction of major Hadoop components and how to get involved with the Hadoop community. Table of Contents Chapter 1. Introduction Chapter 2. ...

    Ubuntu Unleashed 2012 Edition: Covering 11.10 and 12.04 (7th Edition)

    Ubuntu Unleashed 2012 Edition: Covering 11.10 and 12.04 (7th Edition) 作者:Matthew Helmke 出版日期:January 16, 2012 出版社:Sams Publishing ...Learn how to get started developing Android mobile devices

    Learning OpenCV

    With this book, any developer or hobbyist can get up and running with the framework quickly, whether it's to build simple or sophisticated vision applications. Full Description Learning OpenCV puts...

    Introduction to Algorithms(算法导论)

    intended to be a gentle introduction to how we specify algorithms, some of the design strategies we will use throughout this book, and many of the fundamental ideas used in algorithm analysis. Later ...

    Python 2.6 Graphics Cookbook.pdf

    interpreter, for MS Windows or Linux as well as how to verify that Python is correctly installed. This chapter explains how to create complete working programs that can be run on client computers ...

    Raspberry Pi Zero Cookbook

    We start by showing you how to set up and manage the Pi Zero and then move on to configuring the hardware, running it with Linux, and programming it with Python scripts. Later, we integrate the ...

    Senfore_DragDrop_v4.1

    to ask for help via email, but I cannot guarantee that I will have time to help you or even reply to your mail. If you absolytely can't live without my help, you can alway try bribing me. You can ...

    【Linux Device Driver】(3edtion).pdf

    2. Building and Running Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Setting Up Your Test System 15 The Hello World Module 16 Kernel Modules Versus ...

    Docker-in-Action.pdf

    was to create something that would help people of mixed backgrounds get up to speed on Docker as quickly as possible, but in such a way that they understand the underlying mechanisms. The hope is that...

    romfs.2.0.x.gz

    If you want to see how much of a hack this really is, the main files to look at are: gdb-5.0/sim/arm/armmem.c gdb-5.0/sim/arm/armio.c These still include the old 7100 code commented out and the ...

    Universal-USB-Installer

    these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the...

Global site tag (gtag.js) - Google Analytics