一、查看linux系统发行版本
命令1:lsb_release -a
该命令适用于所有Linux系统,会显示出完整的版本信息,包括Linux系统的名称,如Debian、Ubuntu、CentOS等,和对应的版本号,以及该版本的代号,例如在Debian 8中将会显示代号jessie。
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
命令2:cat /etc/issue
该命令适用于所有Linux系统,显示的版本信息较为简略,只有系统名称和对应版本号。
$ cat /etc/issue
Debian GNU/Linux 8 \n \1
命令3:cat /etc/redhat-release
该命令仅适用于Redhat系列的Linux系统,显示的版本信息也较为简略。
$ cat /etc/redhat-release
CentOS release 6.0 (Final)
二、查看Linux内核版本
命令1:uname -a
$ uname -a
Linux CodeBelief 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8ul (2015-04-24) x86_64 GNU/Linux
命令2:cat /proc/version
$ cat /proc/version
Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt9-3~deb8ul (2.15-04-24)
1. gcc -v[root@localhost /]# gcc -v
Reading specs from /usr/i386-glibc-2.1-linux/lib/gcc-lib/i386-glibc21-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
2. rpm -qa|grep gcc
rpm -qi gcc
[root@localhost /]# rpm -qa|grep gcc
gcc-3.2.2-5
gcc-c++-3.2.2-5
libgcc-3.2.2-5
compat-gcc-7.3-2.96.118
gcc-g77-3.2.2-5
gcc-java-3.2.2-5
gcc-gnat-3.2.2-5
compat-gcc-c++-7.3-2.96.118
3. gcc -dumpversion (Display the version of the compiler)
[root@localhost /]# gcc -dumpversion
egcs-2.91.66
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)