centos 查看版本
有以下命令可以查看:# lsb_release -a[html]view plaincopy
- [jifeng@jifeng01hadoop]$lsb_release-a
- LSBVersion::core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
- DistributorID:RedHatEnterpriseServer
- Description:RedHatEnterpriseLinuxServerrelease5.6(Tikanga)
- Release:5.6
- Codename:Tikanga
[html]view plaincopy
- [jifeng@jifeng02~]$lsb_release-a
- LSBVersion::base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
- DistributorID:CentOS
- Description:CentOSrelease6.4(Final)
- Release:6.4
- Codename:Final
這個命令適用於所有的linux,包括Redhat、SuSE、Debian等發行版。[html]view plaincopy
- [jifeng@jifeng01hadoop]$uname
- Linux
- [jifeng@jifeng01hadoop]$uname-r
- 2.6.18-238.el5
- [jifeng@jifeng01hadoop]$uname-i
- x86_64
- [jifeng@jifeng01hadoop]$uname-a
- Linuxjifeng012.6.18-238.el5#1SMPSunDec1914:22:44EST2010x86_64x86_64x86_64GNU/Linux
- [jifeng@jifeng01hadoop]$
以下二種方法適用於RedHat,CentOScat /etc/redhat-release[html]view plaincopy
- [jifeng@jifeng01hadoop]$cat/etc/redhat-release
- RedHatEnterpriseLinuxServerrelease5.6(Tikanga)
[html]view plaincopy
- [jifeng@jifeng02~]$cat/etc/redhat-release
- CentOSrelease6.4(Final)
rpm -q redhat-release[html]view plaincopy
- [jifeng@jifeng01hadoop]$rpm-qredhat-release
- redhat-release-5Server-5.6.0.3