查看方法:
- 用
uname -a
命令,可获取内核版本; - 用
cat /proc/version
命令,可获取版本信息; - 用
cat /etc/issue
或cat /etc/redhat-release
命令,可获取发行版信息。
本教程操作环境:Ubuntu12.04系统。
Linux中查看操作操作系统版本、内存等信息的方法:
1、使用uname -a
[root@iZt4nibhtstmpdf20l7kytZ ~]# uname -a
Linux iZt4nibhtstmpdf20l7kytZ 4.18.0-147.8.1.el8_1.x86_64 #1 SMP Thu Apr 9 13:49:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
2、使用cat /proc/version
[root@iZt4nibhtstmpdf20l7kytZ ~]# cat /proc/version
Linux version 4.18.0-147.8.1.el8_1.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)) #1 SMP Thu Apr 9 13:49:54 UTC 2020
3、 使用cat /etc/issue
[root@iZt4nibhtstmpdf20l7kytZ ~]# cat /etc/issue
\S
Kernel \r on an \m
4、使用cat /etc/redhat-release
[root@iZt4nibhtstmpdf20l7kytZ ~]# cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)
5、使用lsb_release -a
[root@iZt4nibhtstmpdf20l7kytZ ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.1.1911 (Core)
Release: 8.1.1911
Codename: Core