[Linux Installation Date: How to Discover Your System’s Age](https://linuxiac.com/how-to-find-linu...

Linux Installation Date: How to Discover Your System’s Age

查看 Linux 安装时间,通过获取 / 文件系统的 Birth time 来确定:
$ stat /
  File: /
  Size: 188             Blocks: 0          IO Block: 4096   directory
Device: 0,33    Inode: 256         Links: 1
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-03-16 13:11:52.876212014 +0800
Modify: 2023-09-25 09:15:24.162426570 +0800
Change: 2023-09-25 09:15:24.162426570 +0800
 Birth: 2023-03-16 13:11:52.876212014 +0800
$ stat / | awk '/Birth: /{print $2 " " substr($3,1,5)}'
2023-03-16 13:11

#Script #DevOps

source Linux Installation Date: How to Discover Your System's Age
 
 
Back to Top
OKHK