linux查看操作系统版本的方法

发布时间:2022-06-02 11:56:10 作者:yexindonglai@163.com 阅读(811)

查看方法:

  1. uname -a命令,可获取内核版本;
  2. cat /proc/version命令,可获取版本信息;
  3. cat /etc/issuecat /etc/redhat-release命令,可获取发行版信息。

本教程操作环境:Ubuntu12.04系统。

Linux中查看操作操作系统版本、内存等信息的方法:

1、使用uname -a
  1. [root@iZt4nibhtstmpdf20l7kytZ ~]# uname -a
  2. Linux iZt4nibhtstmpdf20l7kytZ 4.18.0-147.8.1.el8_1.x86_64 #1 SMP Thu Apr 9 13:49:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

2、使用cat /proc/version
  1. [root@iZt4nibhtstmpdf20l7kytZ ~]# cat /proc/version
  2. Linux version 4.18.0-147.8.1.el8_1.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)) #1 SMP Thu Apr 9 13:49:54 UTC 2020

3、 使用cat /etc/issue
  1. [root@iZt4nibhtstmpdf20l7kytZ ~]# cat /etc/issue
  2. \S
  3. Kernel \r on an \m

4、使用cat /etc/redhat-release
  1. [root@iZt4nibhtstmpdf20l7kytZ ~]# cat /etc/redhat-release
  2. CentOS Linux release 8.1.1911 (Core)

5、使用lsb_release -a
  1. [root@iZt4nibhtstmpdf20l7kytZ ~]# lsb_release -a
  2. LSB Version: :core-4.1-amd64:core-4.1-noarch
  3. Distributor ID: CentOS
  4. Description: CentOS Linux release 8.1.1911 (Core)
  5. Release: 8.1.1911
  6. Codename: Core

关键字linux