命令lsb_release

来源:互联网 发布:js 给div style属性 编辑:程序博客网 时间:2024/05/21 10:40


在编码时,因某些原因,可能代码要获取系统内核版本信息或依赖系统版本,这时可以利用lsb_release命令来获取系统内核版本相关信息

格式lsb_release [OPTION]...
功能:显示当前系统版本信息。
参数[option]
-v,--version
显示系统兼容的LSB规范版本号,如果不带任何参数,默认-v
-d, --description
显示当前系统的版本
-r, --release
显示系统版本号
-c, --codename
显示系统研发代号
-a, --all
上述所有的信息都会显示
-s, --short
以精简格式来显示信息,默认输出精简LSB规范版本号信息  
-h, --help
显示帮助信息    
实例:

[root test]# lsb_releaseLSB 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[root test]# lsb_release -vLSB 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[root test]# lsb_release -iDistributor ID: CentOS[root test]# lsb_release -dDescription: CentOS release 6.5 (Final)[root test]# lsb_release -rRelease: 6.5[root test]# lsb_release -cCodename: Final[root test]# lsb_release -aLSB 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-noarchDistributor ID: CentOSDescription: CentOS release 6.5 (Final)Release: 6.5Codename: Final[root test]# lsb_release -s: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[root test]# lsb_release -as: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 CentOS "CentOS release 6.5 (Final)" 6.5 Final[root test]# lsb_release -hFSG lsb_release v2.0 prints certain LSB (Linux Standard Base) andDistribution information.


0 0
原创粉丝点击