先说查看linux 内核方法
一:cat /proc/version
[python] view plain copy
- <span style="font-family:'KaiTi_GB2312';font-size:18px;"># cat /proc/version
- Linux version 2.6.32-358.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Fri Feb 22 00:31:26 UTC 2013</span>
二:uname -a[python] view plain copy
- <span style="font-family:'KaiTi_GB2312';font-size:18px;"># uname -a
- Linux mall-giftserver 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux</span>
再说查看linux 系统版本的方法一:lsb_release -a (此命令适用于所有的Linux发行版本)
[python] view plain copy
- <span style="font-family:'KaiTi_GB2312';font-size:18px;"># lsb_release -a
- LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
- Distributor ID: CentOS
- Description: CentOS release 6.4 (Final)
- Release: 6.4
- Codename: Final</span>
二:cat /etc/redhat-release (此方法只适合Redhat系的Linux)
[python] view plain copy
- <span style="font-family:'KaiTi_GB2312';font-size:18px;"># cat /etc/redhat-release
- CentOS release 6.4 (Final)
- You have new mail in /var/spool/mail/root</span>
三:cat /etc/issue (此命令适用于所有的Linux发行版本)
[python] view plain copy
- <span style="font-family:'KaiTi_GB2312';font-size:18px;"># cat /etc/issue
- CentOS release 6.4 (Final)
- Kernel \r on an \m</span>
然后再说安装lsb_release的过程吧在没有此命令的时候,执行会报命令不存在,咋办呢?一个方法:yum provides */lsb_release
当前命令的好处就是帮你找到哪里可以下载到这个lsb_release命令的地方
[python] view plain copy
- # yum provides */lsb_release
- Loaded plugins: fastestmirror
- Loading mirror speeds from cached hostfile
- * base: mirrors.aliyun.com
- * extras: mirrors.btte.net
- * updates: mirrors.aliyun.com
- base/filelists_db | 6.4 MB 00:07
- extras/filelists_db | 38 kB 00:00
- updates/filelists_db | 3.5 MB 00:04
- zabbix/filelists | 65 kB 00:00
- zabbix-non-supported/filelists | 3.0 kB 00:00
- redhat-lsb-core-4.0-7.el6.centos.i686 : LSB base libraries support for CentOS
- Repo : base
- Matched from:
- Filename : /usr/bin/lsb_release
- redhat-lsb-core-4.0-7.el6.centos.x86_64 : LSB base libraries support for CentOS
- Repo : base
- Matched from:
- Filename : /usr/bin/lsb_release
如上所示,应该告诉我们在redhat-lsb-core-4.0-7.el6.centos.i686和redhat-lsb-core-4.0-7.el6.centos.x86_64这两处可以找到,我用的是后一个包中。于是按照下面方法执行
[python] view plain copy
- yum install redhat-lsb-core-4.0-7.el6.centos.x86_64
之后就是一堆执行过程,大致截图如下
等到执行完毕我们验证一下。ok,已成功安装。
然后由安装这个lsb_release命令,新学到了一个方法,就是上面黄底标红的文字yum provides */。
意思就是通过目标命令名称,查找这个命令所属的安装包,比如本文我就是执行的yum provides */lsb_release
以后如果不知道某个命令从哪儿安装,可以考虑使用这个命令来查找。
本文暂时没有评论,来添加一个吧(●'◡'●)