Linux 查看OS Type方法

来源:互联网 发布:java 泛型 通配符继承 编辑:程序博客网 时间:2024/05/12 02:56

由于需要在不同的linux 平台上跑build,鉴于平台之间的差异,需要判断各个平台的OS版本来区分具体的操作。

检查查了下linux 查看系统版本的几种方法。还不少!嘿嘿

 

Linux 查看系统版本的几种方法:

(1)uname -a
Linux pmx02r4******   2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux


(2)cat /etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant)
Kernel  \r on an \m

(3)cat /proc/version

Linux version 2.6.9-5.ELsmp (bhcompile@decompose.build.redhat.com) (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 5 19:30:39 EST 2005


(4)lsb_release -a

LSB Version:    1.3
Distributor ID: RedHatEnterpriseAS
Description:    Red Hat Enterprise Linux AS release 4 (Nahant)
Release:        4
Codename:       Nahant

 

UNAME(1)                        User Commands                        UNAME(1)

NAME
       uname - print system information

SYNOPSIS
       uname [OPTION]...

DESCRIPTION
       Print certain system information.  With no OPTION, same as -s.

       -a, --all
              print all information, in the following order:

       -s, --kernel-name
              print the kernel name

       -n, --nodename
              print the network node hostname

       -r, --kernel-release
              print the kernel release

原创粉丝点击