歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux命令之lsb_release - 查看當前系統的發行版信息

Linux命令之lsb_release - 查看當前系統的發行版信息

日期:2017/2/28 16:17:16   编辑:Linux教程

用途說明

lsb_release命令用來查看當前系統的發行版信息(prints certain LSB (Linux Standard Base) and Distribution information.)。有了這個命令就可以清楚的知道到底是RedHat的、還是別的發行版,還有具體的版本號,比如3.4還是5.4等等。有些系統上不一定安裝了這個命令,可以通過查看/etc/issue文件得到發行版信息。

常用參數

格式:lsb_release

格式:lsb_release -v

查看LSB本身的版本信息。

格式:lsb_release -a

打印本系統發行版的所有信息,比如發行版的ID,描述信息,具體版本,代號。

格式:lsb_release -d -s

格式:head -1 /etc/issue

查看發行版的描述信息,後面實例二展示了這個用法。

使用示例

示例一

[[email protected] ~]# lsb_release
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
[[email protected] ~]# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Release: 5.4
Codename: Tikanga
[[email protected] ~]# lsb_release -v
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
[[email protected] ~]# lsb_release -i
Distributor ID: RedHatEnterpriseServer
[[email protected] ~]# lsb_release -d
Description: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[[email protected] ~]# lsb_release -r
Release: 5.4
[[email protected] ~]# lsb_release -c
Codename: Tikanga
[[email protected] ~]# lsb_release -r -s
5.4

[[email protected] ~]# uname -a
Linux jfht 2.6.18-164.el5PAE #1 SMP Tue Aug 18 15:59:11 EDT 2009 i686 i686 i386 GNU/Linux
[[email protected] ~]# cat /proc/version
Linux version 2.6.18-164.el5PAE ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Aug 18 15:59:11 EDT 2009
[[email protected] ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel \r on an \m

[[email protected] ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[[email protected] ~]#

示例二

[[email protected] ~]# lsb_release -d -s
"Red Hat Enterprise Linux Server release 5.4 (Tikanga)"
[[email protected] ~]# head -1 /etc/issue
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[[email protected] ~]#

示例三

[root@web186 root]# lsb_release
LSB Version: 1.3
[root@web186 root]# lsb_release -a
LSB Version: 1.3
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 3 (Taroon Update 4)
Release: 3
Codename: TaroonUpdate4
[root@web186 root]#

Copyright © Linux教程網 All Rights Reserved