mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-31 23:30:11 +08:00
Merge pull request #1574 from geekpi/master
[Translated]20140811 Linux FAQs with Answers--How to check the last time...
This commit is contained in:
commit
a89fc1180b
@ -1,41 +0,0 @@
|
||||
Translating------------geekpi
|
||||
|
||||
|
||||
Linux FAQs with Answers--How to check the last time system was rebooted on Linux
|
||||
================================================================================
|
||||
> **Question**: Is there a way to quickly check how long a Linux system has been running? That is, how can I find out the last time a Linux system was rebooted?
|
||||
|
||||
There are several ways to find out the last system reboot time,
|
||||
|
||||
### Method One ###
|
||||
|
||||
The first method is to use last command.
|
||||
|
||||
$ last reboot
|
||||
|
||||
![](https://farm4.staticflickr.com/3925/14881994335_041e9c2f86_z.jpg)
|
||||
|
||||
This command actually shows system uptime for the last few days. Originally the last command is designed to show login history of a particular user. In Linux, a special "pseudo user" named reboot automatically logs in to the system right after the system has rebooted. Thus by checking the login history of reboot user, you can check the last reboot time.
|
||||
|
||||
### Method Two ###
|
||||
|
||||
Another command to check the time of last system boot is to use who command with '-b' option.
|
||||
|
||||
$ who -b
|
||||
|
||||
### Method Three ###
|
||||
|
||||
You can also use uptime command to deduce last reboot time. The uptime command shows you the current time, as well as how long the system has been running. From this information, you can calculate the time when the system was last booted.
|
||||
|
||||
$ uptime
|
||||
|
||||
![](https://farm4.staticflickr.com/3915/14881660192_58f2843969_o.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/check-last-time-system-rebooted-linux.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,38 @@
|
||||
Linux FAQ -- 如何检查Linux系统的最后重启时间
|
||||
================================================================================
|
||||
> **问题**: 是否有一个命令可以快速地检查系统已经运行了多久? 也就是我怎么知道Linux最后的重启时间?
|
||||
|
||||
There are several ways to find out the last system reboot time,
|
||||
|
||||
### 方法一 ###
|
||||
|
||||
第一种方法是使用last命令
|
||||
|
||||
$ last reboot
|
||||
|
||||
![](https://farm4.staticflickr.com/3925/14881994335_041e9c2f86_z.jpg)
|
||||
|
||||
这条命令实际上显示的是最近几天的系统运行时间。last原本被设计来显示某个特定用户的登录历史。在Linux中,有一个特别的“伪用户”称为reboot会在系统重启的时候立即登录。这样通过检查reboot用户的登录历史,你就可以检查最后的重启时间。
|
||||
|
||||
### 方法二 ###
|
||||
|
||||
另外一个检测系统最后启动时间的方法是使用who命令带上’-b‘选项。
|
||||
|
||||
$ who -b
|
||||
|
||||
### 方法三 ###
|
||||
|
||||
你同样可以使用uptime命令来推断系统最后的启动时间。uptime命令会显示当前的时间,同样也会显示系统已经运行的时间。从这些信息中,你就可以计算系统最后启动的时间了
|
||||
|
||||
$ uptime
|
||||
|
||||
![](https://farm4.staticflickr.com/3915/14881660192_58f2843969_o.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/check-last-time-system-rebooted-linux.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user