如何查看服务器上运行的是什么操作系统?

在服务器上查看操作系统,可以使用命令行工具。在 Windows 上使用 systeminfo,在 Linux 上使用 uname -acat /etc/os-release

在服务器管理中,了解操作系统的信息至关重要,无论是进行系统维护、故障排查还是软件部署,都需要准确知道服务器上运行的操作系统及其版本,本文将详细介绍如何查看服务器操作系统的方法和步骤,并提供一些常见问题的解答。

如何查看服务器上运行的是什么操作系统?

查看Linux服务器操作系统

1、使用命令行工具:通过SSH登录到Linux服务器后,可以使用以下命令查看操作系统信息:

uname -a:显示内核版本和系统架构信息。

     uname -a

输出示例:

     Linux servername 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a:显示发行版本的详细信息。

     lsb_release -a

输出示例:

     Distributor ID: Ubuntu
     Description: Ubuntu 18.04.4 LTS
     Release: 18.04
     Codename: bionic

cat /etc/os-release:显示操作系统的名称和版本。

     cat /etc/os-release

输出示例:

     NAME="Ubuntu"
     VERSION="18.04.4 LTS (Bionic Beaver)"
     ID=ubuntu
     ID_LIKE=debian
     PRETTY_NAME="Ubuntu 18.04.4 LTS"
     VERSION_ID="18.04"
     HOME_URL="https://www.ubuntu.com/"
     SUPPORT_URL="https://help.ubuntu.com/"
     BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
     PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
     VERSION_CODENAME=bionic
     UBUNTU_CODENAME=bionic

cat /etc/issue:显示操作系统的版本和其他信息。

     cat /etc/issue

输出示例:

     Ubuntu 18.04.4 LTS 
 l

hostnamectl:显示当前Linux系统的操作系统、内核版本和架构等信息。

     hostnamectl

输出示例:

     Static hostname: servername
         Icon name: computer-vm
           Chassis: vm
        Machine ID: e3d7f3e53f7c47af90f1375f2b77e89b
           Boot ID: d9e1e2f37c8d439d88bf6f4f2d3f5f74b
     Operating System: Ubuntu 18.04.4 LTS
          Kernel: Linux 4.15.0-91-generic
    Architecture: x86-64

2、使用图形界面工具:如果服务器有图形界面,可以通过“系统设置”或“系统监视器”等工具查看操作系统信息。

3、使用远程管理工具:如SSH工具远程登录到服务器,然后运行上述命令查看操作系统信息。

查看Windows服务器操作系统

1、使用命令提示符:打开命令提示符,输入以下命令查看操作系统版本:

winver:显示操作系统的版本号和内部版本号。

     winver

systeminfo:显示详细的系统信息,包括操作系统版本、补丁级别等。

     systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

输出示例:

     OS Name:                   Microsoft Windows Server 2019 Standard
     OS Version:                10.0.17763 N/A Build 17763

ver:显示操作系统的版本号和内部版本号。

     ver

输出示例:

     Microsoft Windows [版本 10.0.17763]

wmic os get Caption, /value:以键值对的形式显示操作系统名称。

     wmic os get Caption /value

输出示例:

     Caption=Microsoft Windows Server 2019 Standard|C:WINDOWS|DeviceHarddisk0Partition2

powershell get-computerinfo:显示计算机的详细信息,包括操作系统名称和版本。

     Get-ComputerInfo

输出示例:

     ComputerInfo : Microsoft.PowerShell.CoreCLR.GetComputerInfoJobInstance
     ...
     CsName        : WIN-CCKJMQNQE9H
     OsBiosVersion : American Megatrends Inc. 107.00.3000.00.00.0000
     CsManufacturer : Dell Inc.
     CsModel       : OptiPlex 3020
     OsName        : Microsoft Windows 10 Enterprise
     OsVersion     : 10.0.17763
     OsBuildNumber : 17763

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductName:查询注册表获取产品名称。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductName

输出示例:

如何查看服务器上运行的是什么操作系统?

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     ProductName    REG_SZ    Microsoft Windows 10 Pro

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v CurrentBuild /v DisplayBuildNumber:查询注册表获取当前构建号和显示构建号。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v CurrentBuild /v DisplayBuildNumber

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     CurrentBuild    REG_DWORD    0xb4a
     DisplayBuildNumber  REG_SZ    17763

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ReleaseId:查询注册表获取发布ID。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ReleaseId

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     ReleaseId    REG_SZ    19041

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v UBR:查询注册表获取UBR(统一更新平台)。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v UBR

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     UBR    REG_SZ    DefChannel

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLabEx:查询注册表获取内部版本号和分支。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLabEx

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildLabEx    REG_SZ    19042.vb_release.191206-1742

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLab:查询注册表获取内部版本号和分支。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLab

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildLab    REG_SZ    19042.vb_release.191206-1742

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v EditionID:查询注册表获取版本ID。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v EditionID

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     EditionID    REG_SZ    Professional

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductId:查询注册表获取产品ID。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductId

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     ProductId    REG_SZ    00331-80496-54925-BB849

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v InstallDate:查询注册表获取安装日期。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v InstallDate

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     InstallDate    REG_SZ    2023-10-03T00:00:00.000000000Z

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOrganization:查询注册表获取注册组织。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOrganization

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     RegisteredOrganization    REG_SZ    MyCompany

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOwner:查询注册表获取注册所有者。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOwner

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     RegisteredOwner    REG_SZ    MyUserName

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductName:查询注册表获取产品名称。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductName

输出示例:

     HKEY_LOCINE_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     ProductName    REG_SZ    Microsoft Windows 10 Enterprise 2016 LTSB

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildType:查询注册表获取构建类型。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildType

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildType    REG_SZ    MultiProcessorFree

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLabEx:查询注册表获取内部版本号和分支。

如何查看服务器上运行的是什么操作系统?

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLabEx

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildLabEx    REG_SZ    19042.vb_release.191206-1742

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLab:查询注册表获取内部版本号和分支。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLab

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildLab    REG_SZ    19042.vb_release.191206-1742

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v EditionID:查询注册表获取版本ID。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v EditionID

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     EditionID    REG_SZ    ProfessionalWorkstation

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductId:查询注册表获取产品ID。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductId

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     ProductId    REG_SZ    00331-80496-54925-BB849

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v InstallDate:查询注册表获取安装日期。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v InstallDate

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     InstallDate    REG_SZ    2023-10-03T00:00:00.000000000Z

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOrganization:查询注册表获取注册组织。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOrganization

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     RegisteredOrganization    REG_SZ    MyCompany

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOwner:查询注册表获取注册所有者。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v RegisteredOwner

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     RegisteredOwner    REG_SZ    MyUserName

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductName:查询注册表获取产品名称。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v ProductName

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     ProductName    REG_SZ    Microsoft Windows 10 Enterprise 2016 LTSB

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildType:查询注册表获取构建类型。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildType

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildType    REG_SZ    MultiProcessorFree

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLabEx:查询注册表获取内部版本号和分支。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLabEx

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildLabEx    REG_SZ    19042.vb_release.191206-1742

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLab:查询注册表获取内部版本号和分支。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v BuildLab

输出示例:

     HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
     BuildLab    REG_SZ    19042.vb_release.191206-1742

reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v EditionID:查询注册表获取版本ID。

     reg query "HKLMSOFTWAREMicrosoftWindows NTCurrentVersion" /v EditionID

输出示例:

     HKEY_LOCAL_MACHINESOFTWERvices
t\currentversion\productid\productid\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlabex\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb\buildlb \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld \ buildld ; currentversion ; productid ; productid ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaboratory ; builtlaborator;;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaboratory;builtlaborator

原创文章,作者:未希,如若转载,请注明出处:https://www.kdun.com/ask/1481856.html

本网站发布或转载的文章及图片均来自网络,其原创性以及文中表达的观点和判断不代表本网站。如有问题,请联系客服处理。

(0)
未希
上一篇 2025-01-13 02:03
下一篇 2024-02-18 09:26

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

产品购买 QQ咨询 微信咨询 SEO优化
分享本页
返回顶部
云产品限时秒杀。精选云产品高防服务器,20M大带宽限量抢购 >>点击进入