![vc编程查找计算机运行记录](https://i-blog.csdnimg.cn/blog_migrate/ed7cbca4dd843693bd85cebe13feec09.png)
vc编程查找计算机运行记录
![computer-uptime computer-uptime](https://i-blog.csdnimg.cn/blog_migrate/15cda4e749419f28e0161ddc2957dc1a.png)
“My computer’s been running for 100 days without a reboot!” “I haven’t reinstalled Windows in five years!” Geeks love to brag about this stuff. Here’s how to find your uptime and installation date on Windows, Linux, and Mac.
“我的计算机已经运行了100天,没有重新启动!” “五年来我没有重新安装Windows !” 极客们喜欢吹牛。 这是在Windows,Linux和Mac上查找正常运行时间和安装日期的方法。
“Uptime” is a geeky term that refers to how long a system has been “up” and running without a shut down or restart. It’s a bigger deal on servers than typical desktops.
“正常运行时间”是一个令人讨厌的术语,指的是系统已启动并运行了多长时间而没有关闭或重新启动。 与典型的台式机相比,服务器上的交易量更大。
Windows-正常运行时间 (Windows — Uptime)
Your Windows system’s uptime is displayed in the Task Manager. Right-click the taskbar and select Task Manager or press Ctrl+Shift+Escape to open it.
Windows系统的正常运行时间显示在任务管理器中 。 右键单击任务栏,然后选择“任务管理器”,或按Ctrl + Shift + Escape将其打开。
On Windows 8, click the Performance tab and look under “Up time” at the bottom of the window.
在Windows 8上,单击“性能”选项卡,然后在窗口底部的“正常运行时间”下查看。
![find-uptime-on-windows-8 find-uptime-on-windows-8](https://i-blog.csdnimg.cn/blog_migrate/2a9d358c5ed31fee19c60ab1813c2ba2.png)
On Windows 7 or Vista, you’ll also find this information on then Performance tab — look for “Up time” under System.
在Windows 7或Vista上,您还可以在“性能”选项卡上找到此信息-在“系统”下查找“正常运行时间”。
![find-up-time-on-windows-7 find-up-time-on-windows-7](https://i-blog.csdnimg.cn/blog_migrate/fb9fe4e2a6c38b082ce89e836c5c08f4.png)
Windows-安装日期 (Windows — Installation Date)
You can find the date you installed Windows with the systeminfo command. First, open the Command Prompt — press Windows Key + R, type cmd into the Run dialog, and press Enter. Type the following command into the Command Prompt window and press Enter (note that you must type Original with the capital letter on older versions of Windows).
您可以使用systeminfo命令找到安装Windows的日期。 首先,打开命令提示符-按Windows键+ R,在“运行”对话框中键入cmd ,然后按Enter。 在“命令提示符”窗口中键入以下命令,然后按Enter键(请注意,在较早版本的Windows上,必须键入Original并使用大写字母)。
systeminfo | find /i “Original”
systeminfo | 找到/ i“原始”
If you are using Windows 7 or Vista you might need to use this line instead:
如果您使用的是Windows 7或Vista,则可能需要使用以下代码:
systeminfo | find “Original”
systeminfo | 找到“原始”
![find-windows-installation-date find-windows-installation-date](https://i-blog.csdnimg.cn/blog_migrate/b7e3ae6084d66bcf127ca8e472bf156f.png)
Linux —正常运行时间 (Linux — Uptime)
Many Linux utilities display your uptime, from the “top” command to graphical system information utilities.
从“ top”命令到图形系统信息实用程序,许多Linux实用程序都会显示您的正常运行时间。
There’s also a dedicated uptime command to display this information. To see your uptime on Linux, open a terminal window, type the following command, and press Enter:
还有一个专用的正常运行时间命令来显示此信息。 要在Linux上查看正常运行时间,请打开终端窗口,键入以下命令,然后按Enter:
uptime
正常运行时间
![find-uptime-on-linux-system find-uptime-on-linux-system](https://i-blog.csdnimg.cn/blog_migrate/b7ef7a49cded3752dab59c8fdfc6e3c6.png)
Linux —安装日期 (Linux — Installation Date)
There’s no one standard way to see when you installed your Linux system. What you want to do is find a file that hasn’t been modified since you installed Linux and see when it was created.
没有什么标准方法可以查看何时安装Linux系统。 您要做的是找到自安装Linux以来未修改过的文件,并查看它的创建时间。
For example, Ubuntu’s installer creates log files at /var/log/installer when you install it. You can check when this directory was created to see when the Ubuntu system was installed. To do this, open a terminal window and run the following command:
例如,Ubuntu的安装程序在安装时会在/ var / log / installer中创建日志文件。 您可以检查何时创建此目录,以查看何时安装了Ubuntu系统。 为此,请打开一个终端窗口并运行以下命令:
ls -ld /var/log/installer
ls -ld / var / log / installer
The time and date the folder was created is when you installed your Linux system.
创建文件夹的时间和日期是安装Linux系统的时间。
![find-ubuntu-installation-date find-ubuntu-installation-date](https://i-blog.csdnimg.cn/blog_migrate/43061910a0a377d1fde0f168135338fc.png)
You might also try looking at the /lost+found folder, which is generally created when you install Linux and set up your drive. This should work on other Linux distributions, too:
您也可以尝试查看/ lost + found文件夹,该文件夹通常是在安装Linux并设置驱动器时创建的。 这也应该适用于其他Linux发行版 :
ls -ld /lost+found
ls -ld / lost + found
![find-linux-system-installation-date find-linux-system-installation-date](https://i-blog.csdnimg.cn/blog_migrate/9f9cccce97b1aee793a05adeea989d2b.png)
Mac OS X-正常运行时间 (Mac OS X — Uptime)
Your Mac system displays its uptime in the System Information window. Click the Apple menu icon on the bar at the top of your screen, hold down the Option key, and click System Information. Scroll down in the left pane, select Software, and look for “Time since boot” to see your Mac’s uptime.
您的Mac系统在“系统信息”窗口中显示其正常运行时间。 单击屏幕顶部栏上的Apple菜单图标,按住Option键,然后单击“系统信息”。 在左窗格中向下滚动,选择“软件”,然后查找“自启动以来的时间”以查看Mac的正常运行时间。
![find-mac-os-x-uptime find-mac-os-x-uptime](https://i-blog.csdnimg.cn/blog_migrate/65206b1650ba208ca014ae50ecfd75fd.png)
You can also use the uptime command on a Mac, too. Press Command + Space, type Terminal, and press Enter to open a terminal window. Run the uptime command.
您也可以在Mac上使用正常运行时间命令。 按Command + Space,输入Terminal ,然后按Enter打开终端窗口。 运行正常运行时间命令。
![find-mac-os-x-uptime-in-terminal find-mac-os-x-uptime-in-terminal](https://i-blog.csdnimg.cn/blog_migrate/15f4ec04c8673a507066d2ea96c08732.png)
Mac OS X-安装日期 (Mac OS X — Installation Date)
You should be able to find when your Mac OS X system was installed from its install.log file. First, open the Console application. Press Command + Space, type Console, and press Enter to open it. Expand the /var/log folder in the sidebar, scroll down, and click install.log in the list. Scroll up to the top of the install.log file and look at the oldest date there.
您应该能够从install.log文件中找到安装Mac OS X系统的时间。 首先,打开控制台应用程序。 按Command + Space ,键入Console ,然后按Enter将其打开。 展开侧栏中的/ var / log文件夹,向下滚动,然后在列表中单击install.log。 向上滚动至install.log文件的顶部,然后查看那里的最早日期。
If you’ve been using your Mac for a while, there may be archived install.log files with the names install.log.0.gz, install.log.1.gz, and so on. Open the oldest one, which is the one that has the highest number in its name.
如果您使用Mac已有一段时间,则可能存在名为install.log.0.gz,install.log.1.gz等的已归档install.log文件。 打开最旧的,即名称中编号最高的那个。
![find-mac-os-x-installation-date find-mac-os-x-installation-date](https://i-blog.csdnimg.cn/blog_migrate/d12c8ea126ea1884b48c32c635bf27ec.png)
This information is interesting, especially when you compare it with other people’s computers. There’s not much practical to be done with this information, of course — it’s mostly for bragging rights.
此信息很有趣,尤其是当您将其与其他人的计算机进行比较时。 当然,使用此信息并没有太多实际操作-主要是为了吹牛。
Image Credit: Trevor Manternach on Flickr
图片来源: Flickr上的Trevor Manternach
vc编程查找计算机运行记录