1.查看ubuntu版本号:
方法一:
cat /etc/issue
返回结果:
Ubuntu 16.04.6 LTS \n \l
方法二:
sudo lsb_release -a
返回结果:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
方法三:
cat /etc/lsb-release
返回结果:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
2.查看内核版本号:
方法四:
cat /proc/version
返回结果:
Linux version 4.15.0-74-generic (buildd@lgw01-amd64-036) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)) #83~16.04.1-Ubuntu SMP Wed Dec 18 04:56:23 UTC 2019
方法五:
uname -a
返回结果:
4.15.0-74-generic #83~16.04.1-Ubuntu SMP Wed Dec 18 04:56:23 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
方法六:仅仅查看内核版本
uname -r
返回结果:
4.15.0-74-generic