Linux中记录在线时长的uptime命令

如何获得Linux服务器当前已经运行了多久呢,可以通过uptime命令,执行该命令后会返回一组数据

如:

20:03:36 up 11:41,  3 users,  load average: 0.15, 0.14, 0.05

其中,

20:03:36    当前的系统时间

11:41         服务器开机后持续的运行时间

3 users      当前登录到系统的用户数,包括通过远程工具登录的

load average 分别代表了最近1分钟、5分钟、15分钟系统的平均负载

 

还可以通过访问/proc/uptime

man /proc

/proc/uptime
This  file  contains  two  numbers:

1. the uptime of the system (seconds)

2. the amount of time spent in idle process (seconds).

 

猜你喜欢

转载自zhao-rock.iteye.com/blog/2016089
今日推荐