如何查看Linux系统使用的版本信息呢? 下面这篇文章收集、整理了一些常见的查看Linux系统版本的方法。由于手头只有Oracle Linux、Centos Linux、Redhat Linux三个版本Linux,所以像Debian、Ubuntu之类的Linux系统,下面方法在这些版本都没测试过。1:more /etc/issue 命令查看1.1 Oracle Linux 复制代码代码如下: [root@DB-Server ~]# more /etc/issueOracle Linux Server release 5.7Kernel r on an m 1.2 Centos Linux 复制代码代码如下:[root@Centos2 ~]# more /etc/issueCentOS release 6.4 (Final)Kernel r on an m 1.3 RedHat Linux 复制代码代码如下:[root@getlnx ~]# more /etc/issueRed Hat Enterprise Linux Server release 5.7 (Tikanga)Kernel r on an m 2: lsb_release -a 命令查看 2.1 Oracle Linux 复制代码代码如下:[root@DB-Server ~]# lsb_release -aLSB Version: :core-4.0-amd:core-4.0-ia:core-4.0-noarch:graphics-4.0-amd:graphics-4.0-ia:graphics-4.0-noarch:printing-4.0-amd:printing-4.0-ia:printing-4.0-noarchDistributor ID: EnterpriseEnterpriseServerDescription: Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)Release: 5.7Codename: Carthage2.2 Centos Linux复制代码代码如下:[root@Centos2 ~]# lsb_release -aLSB Version: :base-4.0-amd:base-4.0-noarch:core-4.0-amd:core-4.0-noarch:graphics-4.0-amd:graphics-4.0-noarch:printing-4.0-amd:printing-4.0-noarchDistributor ID: CentOSDescription: CentOS release 6.4 (Final)Release: 6.4Codename: Final2.3 RedHat Linux复制代码代码如下:[root@getlnx ~]# lsb_release -aLSB Version: :core-4.0-amd:core-4.0-ia:core-4.0-noarch:graphics-4.0-amd:graphics-4.0-ia:graphics-4.0-noarch:printing-4.0-amd:printing-4.0-ia:printing-4.0-noarchDistributor ID: RedHatEnterpriseServerDescription: Red Hat Enterprise Linux Server release 5.7 (Tikanga)Release: 5.7Codename: Tikanga3:cat /etc/redhat-release 命令查看这个命令应该只有部分Linux可以查看,不是所有版本Linux都可以使用该命令3.1 Oracle Linux 复制代码代码如下:[root@DB-Server ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.7 (Tikanga) [root@DB-Server etc]# cat /etc/*releaseEnterprise Linux Enterprise Linux Server release 5.7 (Carthage)Oracle Linux Server release 5.7Red Hat Enterprise Linux Server release 5.7 (Tikanga)[root@DB-Server etc]# ls /etc/*lease/etc/enterprise-release /etc/oracle-release /etc/redhat-release[root@DB-Server etc]# 3.2 Centos Linux复制代码代码如下:[root@Centos2 ~]# cat /etc/redhat-release CentOS release 6.4 (Final) [root@Centos2 ~]# cat /etc/*releaseCentOS release 6.4 (Final)LSB_VERSION=base-4.0-amd:base-4.0-noarch:core-4.0-amd:core-4.0-noarch:graphics-4.0-amd:graphics-4.0-noarch:printing-4.0-amd:printing-4.0-noarchCentOS release 6.4 (Final)CentOS release 6.4 (Final)[root@Centos2 ~]# ls /etc/*release/etc/centos-release /etc/lsb-release /etc/redhat-release /etc/system-release[root@Centos2 ~]# 3.3 RedHat Linux复制代码代码如下:[root@getlnx ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.7 (Tikanga) [root@getlnx ~]# cat /etc/*releaseRed Hat Enterprise Linux Server release 5.7 (Tikanga)[root@getlnx ~]# ls /etc/*release/etc/redhat-release[root@getlnx ~]#4 rpm -q redhat-release命令查看,只适用于Redhat Linux复制代码代码如下:[root@getlnx ~]# rpm -q redhat-release redhat-release-5Server-5.7.0.3
推荐整理分享查看Linux系统版本信息的方法小结(查看linux系统版本信息),希望有所帮助,仅作参考,欢迎阅读内容。
![查看Linux系统版本信息的方法小结(查看linux系统版本信息)](https://www.jiuchutong.com/image/20240129/1706497479.jpg)
文章相关热门搜索词:查看linux系统版本,如何查看linux系统版本号,查看Linux系统版本的命令有哪些?,查看linux系统版本信息,查看linux系统版本号,查看Linux系统版本命令,查看linux系统版本,查看Linux系统版本的命令有哪些?,内容如对您有帮助,希望把文章链接给更多的朋友!
Linux系统中strace命令的使用教程 在调试的时候,strace能帮助你追踪到一个程序所执行的系统调用。当你想知道程序和操作系统如何交互的时候,这是极其方便的,比如你想知道执行了
使用strace命令定位和诊断故障的实例分享 通过Strace定位故障原因这是一个Nginx错误日志:connect()failed(:Connectiontimedout)whileconnectingtoupstreamconnect()failed(:Connectionrefused)whileconnectingtoupstream看上去
linux中使用root权限都删除不了的文件该怎办? 在linux系统中,root用户拥有最高权限,可以干任何事情,但是有些时候,root用户却不能删除一个小小的一般文件。其实只要root用户更改下这个文件的属