查看Linux内核版本及系统版本

Linux.png

简介

记录一下查看Linux内核版本及系统版本的几种命令。

命令

查看Linux内核版本命令:

  • cat /proc/version

    1
    2
    [root@ZPVMLIST-YS ~]# cat /proc/version
    Linux version 2.6.32-573.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Thu Jul 23 15:44:03 UTC 2015
  • uname -a

    1
    2
    [root@ZPVMLIST-YS ~]# uname -a
    Linux ZPVMLIST-YS 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  • uname -sr

    1
    2
    [root@ZPVMLIST-YS ~]# uname -sr
    Linux 2.6.32-573.el6.x86_64

查看Linux系统版本的命令:

  • lsb_release -a,列出所有系统版本信息该命令适用于所有的Linux,包括Redhat、SuSE、Debian等发行版。

    1
    2
    3
    4
    5
    6
    [root@ZPVMLIST-YS ~]# lsb_release -a
    LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
    Distributor ID: CentOS
    Description: CentOS release 6.7 (Final)
    Release: 6.7
    Codename: Final
  • cat /etc/issue,此命令也适用于所有的Linux发行版。

    1
    2
    3
    [root@ZPVMLIST-YS ~]# cat /etc/issue
    CentOS release 6.7 (Final)
    Kernel \r on an \m
  • cat /etc/redhat-release,该命令只适合Redhat系的Linux。

    1
    2
    [root@ZPVMLIST-YS ~]# cat /etc/redhat-release
    CentOS release 6.7 (Final)
  • file /bin/bash

    1
    2
    [root@ZPVMLIST-YS ~]# file /bin/bash
    /bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
  • file /bin/cat

    1
    2
    [root@ZPVMLIST-YS ~]# file /bin/cat
    /bin/cat: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped