Linux下查看版本号的命令
1,查看内核版本命令:
cat /proc/version
uname -a
uname -rcat /etc/issue
man uname
2,查看linux版本:抄录如下:
1) 登录到服务器执行 lsb_release -a ,即可列出所有版本信息,例如:
[root@3.5.5Biz-46 ~]# lsb_release -a
LSB Version: 1.3
Distributor ID: RedHatEnterpriseAS
Descrīption: Red Hat Enterprise Linux AS release 4 (Nahant Update 1)
Release: 4
Codename: NahantUpdate1
[root@3.5.5Biz-46 ~]#
这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。
2) 登录到linux执行cat /etc/redhat-release ,例如如下:
[root@3.5.5Biz-46 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 1)
[root@3.5.5Biz-46 ~]#
这种方式下可以直接看到具体的版本号,比如 AS4 Update 1
3)登录到linux执行rpm -q redhat-release ,例如如下
[root@3.5.5Biz-46 ~]# rpm -q redhat-release
redhat-release-4AS-2.4
[root@3.5.5Biz-46 ~]#
这种方式下可看到一个所谓的release号,比如上边的例子是2.4
这个release号和实际的版本之间存在一定的对应关系,如下纤拦衫:
redhat-release-3AS-1 -> Redhat Enterprise Linux AS 3
redhat-release-3AS-7.4 -> Redhat Enterprise Linux AS 3 Update 4
redhat-release-4AS-2 -> Redhat Enterprise Linux AS 4
redhat-release-4AS-2.4 ->衡兄 Redhat Enterprise Linux AS 4 Update 1
redhat-release-4AS-3 -> Redhat Enterprise Linux AS 4 Update 2
redhat-release-4AS-4.1 -> Redhat Enterprise Linux AS 4 Update 3
redhat-release-4AS-5.5 -> Redhat Enterprise Linux AS 4 Update 4
更多Linux知识可参考书籍《毁腔Linux就该这么学》。
linux 查看版本命令
git版本歼桐
git --version
git version 1.8.3.1
maven 版本
mvn -v
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00)
Maven home: /usr/local/maven/apache-maven-3.6.1
Java version: 1.8.0_161, vendor: Oracle Corporation, runtime: /usr/local/java/jdk1.8.0_161/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-862.el7.x86_64", arch: "amd64", family: "unix"
java 版本
java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
mysql版本
mysql -V
mysql Ver 14.14 Distrib 5.7.22, for Linux (x86_64) using EditLine wrapper
ssh 版本
ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
python版本氏闹坦
(一台服务器可以安装两个版本python:一般系统自带python2,可自己下个Python-3.5.2.tgz 安装python3)
python -V
Python 2.7.5
python3 -V
Python 3.5.2
mongodb版本
mongo --version
MongoDB shell version v3.6.9
git version: 167861a164723168adfaaa866f310cb94010428f
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: none
build environment:
distmod: rhel70
distarch: x86_64
target_arch: x86_64 《Linux就该这么弯烂学》详细的有关Linux的介绍可以了解下。
Linux常用查看版本指令
1.查看linux版本
cat /etc/issue
2.查看内核版本
cat /proc/version
或者使蠢敏用uname指令
Copy-a, --all print all information, in the following order, 查看全部信息
except omit -p and -i if unknown:
-s, --kernel-name print the kernel name 查看内核名字
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release 查看内核发行版本
-v, --kernel-version print the kernel version 查看内核版本
-m, --machine print the machine hardware name
-p, --processor print the processor type or "派档慧unknown"-i, --hardware-platform print the hardware platform or "unknown"-o, --operating-system print the operating system 查看操作系统
--help display this help and exit--version output version information and exit
4.查看系尘答统位数
Copyfile /bin/bash
5.查看gcc版本
Copygcc --version 想了解更多Linux知识可参考书籍《Linux就该这么学》。