
Linux/Unix 系统管理员对服务器的系统运行时间有一种奇怪的痴迷。

望名生义,uptime 命令告诉你系统启动了(运行了)多长时间。这是语法:

你可以使用下面的工具来查看 Linux 或类 Unix 系统运行了多长时间: uptime : 告诉你服务器运行了多长的时间。 lastt : 显示重启和关机时间。 tuptime : 报告系统的运行时间历史和运行时间统计,这是指重启之间的运行时间。和 uptime 命令类似,不过输出结果更有意思。 找出系统上次重启时间和日期 你可以使用下面的命令来获取Linux操作系统的上次重启和关机时间及日期(在OSX/类Unix系统上也可以用): ### 显示系统重启和关机时间 who -b last reboot last shutdown ### 开机信息 uptime cat /proc/uptime awk ‘{ print "up " $1 /

对于一些人来说系统运行了多久是无关紧要的,但是对于服务器管理员来说,这是相当重要的信息。服务器在运行重要应用的时候,必须尽量保证长时间的稳定运行,有时候甚至要求零宕机。那么我们怎么才能知道服务器运行了 …