@haokuixi
2018-04-20T01:18:18.000000Z
字数 1217
阅读 1297
linux
os
cat /proc/version
Linux version 2.6.18-238.el5 (mockbuild@x86-012.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Sun Dec 19 14:22:44 EST 2010
uname -r
2.6.18-238.el5
uname -a
Linux SOR_SYS.99bill.com 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
这个命令适用于所有的 Linux,包括 Redhat、SuSE、Debian 等发行版。
LSB Version: :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
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Release: 4
Codename: NahantUpdate4
cat /etc/issue
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Kernel \r on an \m
下面的两种方法只对 Redhat Linux 有效
cat /etc/redhat-release
这种方式可以直接看到具体的版本号,比如 AS4 Update 1
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
rpm -q redhat-release
这种方式下可看到一个所谓的 release 号,例如下边的是5
redhat-release-5Server-5.6.0.3
file /bin/bash
/bin/bash: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
file /bin/cat
/bin/cat: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped