mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-25 00:50:15 +08:00
translated by NearTan
This commit is contained in:
parent
9b0ae4a2de
commit
a11493e929
@ -1,52 +0,0 @@
|
||||
NearTan 选题
|
||||
Linux Uptime Command – Find How Long Your System Been Running
|
||||
================================================================================
|
||||

|
||||
|
||||
Information about how long the system has been running may not critical for some people. But for server administrators, it is critical. Servers which running mission critical application must be running as long as possible. Sometimes it must be zero-downtime. So, how can we know information about it?
|
||||
|
||||
On Linux operating system, we can use uptime command. You don’t need root privileges to run this command. This command also already installed on Linux system by default.
|
||||
|
||||
The syntax is like this :
|
||||
|
||||
$ uptime
|
||||
|
||||
You may see an output like this :
|
||||
|
||||

|
||||
|
||||
This information is provided in **/proc/uptime** file. Even the file is text based, but it’s a raw information which is not directly human-readable. That’s why we need uptime command to translate it.
|
||||
|
||||
Here’s how to read the information provided by uptime :
|
||||
|
||||
### System Time ###
|
||||
|
||||
You see at the Figure 1 above, the first information on the left side is **14:04:39**. It shows you the system time in 24 hours format.
|
||||
|
||||
### System Uptime ###
|
||||
|
||||
The second information is **Up 1004 days, 12:20.** It give you a timeframe how long the system has been running. From the Figure 1, it shows you that the system has been running for 1004 days and 12 hours – 20 minutes. If the system has not pass 24 hours then it will show you only hours and / or minutes timeframe. Take a look at Figure 2 and Figure 3 below. When the system is restarted then the counter will be reset to zero.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Numbers of Users Logged In ###
|
||||
|
||||
The third information is uptime shows you numbers of users logged in. Figure 1 show you that there is **1 user** logged at that time. When there is multiple user logged in, uptime will tell you the numbers.
|
||||
|
||||
### Load Average ###
|
||||
|
||||
The last information is about the average load of the system. From the Figure 1 again you see numbers **0.25, 0.25, 0.19**. The two decimal point is translated as a percentage. 0.25 means 25% and 0.19 means 19%.
|
||||
|
||||
While the sequence 0.25, 0.25, 0.19 represent for the past 1 minutes, 5 minutes and 15 minutes. The lower numbers you get mean the better your system will perform.
|
||||
|
||||
That’s the usage of the **uptime** command in daily used. For more detailed information, please refer to uptime manual page by typing **man uptime** in your Linux console.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/linux-uptime-command/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,51 @@
|
||||
Linux Uptime 命令,让你知道你的系统运行了多久
|
||||
================================================================================
|
||||

|
||||
|
||||
|
||||
系统运行了多久对于一些人来说是无关紧要的,但是对于服务器管理员来说,这是相当重要的信息。服务器在运行重要的应用的时候,必须尽量保证长时间的稳定运行,有时候甚至要求零宕机。那么我们怎么才能知道服务器运行了多久呢?
|
||||
|
||||
在Linux 下,我们可以使用uptime 命令,而且此命令不必使用root 权限。uptime 命令在系统中已经默认安装了。
|
||||
|
||||
语法就像这样:
|
||||
|
||||
$ uptime
|
||||
|
||||
你会在屏幕上看到类似这样的显示:
|
||||
|
||||

|
||||
|
||||
这些信息保存在/proc/uptime 文件中,虽然是以文本方式保存,但是这些数据却不能直接显示,需要我们使用uptime 命令来翻译它。
|
||||
|
||||
下面来讲解如何解读运行uptime 命令后显示的信息:
|
||||
|
||||
### 系统时间 ###
|
||||
|
||||
在图1中,左起第一个信息是14:04:39,这就是当前系统时间,以24小时格式输出。
|
||||
|
||||
### 系统运行时间 ###
|
||||
|
||||
第二个信息**Up 1004 days, 12:20**,这是显示你的系统运行的时间。这里显示的是到目前(即第一个时间)为止,你的系统运行了1004天12小时20分钟,如果你的系统没有运行超过24小时,这里将只会显示小时分钟或者只显示分钟。注意图2、图3的信息,当系统重启后将会清零。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 已登陆用户的数量 ###
|
||||
|
||||
第三部分的信息是显示已登陆用户的数量。在图1中,显示的是**1 user** ,即当前登录用户数量。当多个用户在同时登陆系统时,uptime 命令将告诉你用户的数量。
|
||||
|
||||
### 平均负载量 ###
|
||||
|
||||
最后一个信息是系统的平均负载量。回到图1,你看到这样带两位小数的数字**0.25, 0.25, 0.19**可以换算成百分比,即0.25和0.19分别代表着25%和19%。
|
||||
19代表着过去1分钟、5分钟、15分钟系统的平均负载量。负载量越低意味着你的系统性能越好。
|
||||
|
||||
这就是**uptime** 命令的日常使用指导,如果想获取更详细的信息,请通过输入**man uptime** 进入uptime 命令的manual 页面来查看。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/linux-uptime-command/
|
||||
|
||||
译者:[NearTan](https://github.com/NearTan) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user