linux命令 uptime详解
引言:从今天开始,每周更新一个对程序员有用的linux命令,我真的没敢写每天一个,我怕我坚持不下去,每周一个还是可以的。既然每周一个了,就肯定不能拿ls,chmod这种命令来凑数了。降低数量,保障质量。与大家共勉。
进入正题
我们先来看一下命令执行结果
11:10:42 up 4 days, 19:23, 2 users, load average: 3.17, 3.45, 3.65
我们来分组解释一下,大概分成一下几个部分
我们使用man uptime命令进行查询uptime的说明如下(man命令不了解的稍微百度一下就明白,这是一个类似手册的功能)
注:一般我们使用 uptime -h 即命令加-h或--help的形式得到的是比较简单的帮助文档,而man命令一般会给出更详细的解释,不过一般都是英文的,其实也没有太难的词语希望大家坚持英文阅读。提高技术水平的同时也潜移默化的提高了英语水平
uptime gives a one line display of the following information.
The current time, how long the system has been running, how many
users are currently logged on, and the system load averages for
the past 1, 5, and 15 minutes.
This is the same information contained in the header line dis‐
played by w(1).
System load averages is the average number of processes that are
either in a runnable or uninterruptable state. A process in a
runnable state is either using the CPU or waiting to use the CPU.
A process in uninterruptable state is waiting for some I/O
access, eg waiting for disk. The averages are taken over the
three time intervals. Load averages are not normalized for the
number of CPUs in a system, so a load average of 1 means a single
CPU system is loaded all the time while on a 4 CPU system it
means it was idle 75% of the time.
当然我知道大部分童鞋是不想看那么长串的英文的linux命令大全,我翻译了一下如下:
uptime 在一行中给了如下信息:当前时间,系统已经运行了多久,多少用户连接目前正在使用系统,系统在过去1,5,15分钟内的平均负载。
下一个教程:运维应该知道的Linux命令