version 大全

这篇文章总结下一些常用的 系统 或者 软件 如何查看其版本号,方便后续查阅。

注:如果没有特殊说明,输入的命令在 Windows 下和 Linux 下都有效。

Windows 系统版本

在 CMD 中输入:

1
ver

我的笔记本是 win10 系统,输出为:

1
2
3
C:\Users\tanjuntao>ver

Microsoft Windows [版本 10.0.18363.778]

Python 版本

在 windows 的 CMD 或者 Linux 的命令行中输入:

1
python --version

输出:

1
2
C:\Users\tanjuntao>python --version
Python 3.6.3

MySQL 版本

当我们登录到 MySQL 时,会有提示信息输出,可以找到 Server Version 关键字,后面就是我们 MySQL 的版本号。

还有另外一种查看版本号的方法。先登录 MySQL,然后输入:

1
mysql> select version();

输出:

1
2
3
4
5
6
7
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.11 |
+-----------+
1 row in set (0.00 sec)

npm 版本

前提是 npm 已经加入到系统环境变量中,我们只需要在命令行中输入:

1
npm -v

输出:

1
2
PS C:\Users\tanjuntao> npm -v
6.4.1

pip 版本

输入:

1
pip --version

输出:

1
2
user@DataServer:~$ pip --version
pip 19.1.1 from /home/user/.local/lib/python3.5/site-packages/pip (python 3.5)

conda 版本

输入:

1
conda --version

输出:

1
2
user@DataServer:~$ conda --version
conda 4.5.11

node.js 版本

输出 :

1
node -v

输出:

1
2
PS C:\Users\tanjuntao> node  -v  
v10.13.0

ubuntu 版本

输入:

1
lsb_release -a

输出:

1
2
3
4
5
6
user@DataServer:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

从输出结果中可以看到,该服务器中安装的 ubuntu 版本是 16.04 LTS,发行版本代号是 xenial

我们看另一个版本是 18.04 LTS 的 ubuntu:

1
2
3
4
5
6
tan@DESKTOP-OPQIR8V:/mnt/c/Users/tanjuntao$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

从输出结果中我们可以知道,该版本的发行代号是 bionic

使用 apt 查看某个软件包版本

输入:

1
apt show <包名>

这里以查看 tmux 的版本为例;

1
apt show tmux

输出:

1
2
3
4
5
6
7
8
9
10
11
12
tan@DESKTOP-OPQIR8V:/mnt/c/Users/tanjuntao$ apt show tmux
Package: tmux
Version: 2.6-3ubuntu0.2
Priority: optional
Section: admin
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Romain Francoise <rfrancoise@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 647 kB
......
<Content Omitted>

从输出的结果的 Version 字段可以知道软件包的版本。

Linux 内核版本

有两种方式可以查看内核版本号。

  1. 1
    cat /proc/version

    输出:

    1
    2
    tan@tjt1024:/mnt/c/Users/tanjuntao$ cat /proc/version
    Linux version 4.4.0-18362-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #836-Microsoft Mon May 05 16:04:00 PST 2020
  2. 1
    uname -a

    输出:

    1
    Linux tjt1024 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux

Google Chrome 版本

1
$ google-chrome --version

Firefox 版本

1
$ firefox --version
Donate comment here