gpt4 book ai didi

linux - 检查安装了哪个操作系统(CentOS、Ubuntu、Redhat 等)

转载 作者:太空宇宙 更新时间:2023-11-04 12:51:29 27 4
gpt4 key购买 nike

我得到了一台安装了操作系统的服务器。我想检查其中安装了哪个操作系统。我使用 uname -a 输出为 Linux ctl 2.6.32-573.3.1.el6.x86_64 #1 SMP Mon Aug 10 09:44:54 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

有什么建议吗?

最佳答案

您可以使用/etc/os-release 文件,其中包含有关使用 freedesktop 规范的操作系统的信息。

仅打印操作系统名称和版本:

awk -F '=' '/PRETTY_NAME/ { print $2 }' /etc/os-release

关于linux - 检查安装了哪个操作系统(CentOS、Ubuntu、Redhat 等),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37039997/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com