cat /proc/version

推荐使用此方法获取Linux版本信息

  • 查看显示内存中kernel相关的版本、编译等信息
  • Ubuntu和CentOS通用,可以显示内核版本同时显示发行版本
sun@u20a:/root$ cat /proc/version
Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021
[root@C8-186 ~]# cat /proc/version
Linux version 4.18.0-147.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)) #1 SMP Wed Dec 4 21:51:45 UTC 2019

uname -a

  • uname命令用来查看系统信息,Ubuntu和CentOS通用
  • 只有内核版本,没有发行版本
sun@u20a:/root$ uname -a
Linux u20a 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@C8-186 ~]# uname -a
Linux C8-186 4.18.0-147.el8.x86_64 #1 SMP Wed Dec 4 21:51:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • uname详细信息
sun@u20a:/root$ whatis uname
uname (1)            - print system information
sun@u20a:/root$ uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.-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 (non-portable)-i, --hardware-platform  print the hardware platform (non-portable)-o, --operating-system   print the operating system--help     display this help and exit--version  output version information and exit

cat /etc/issue

不推荐,但是可以快速取到Ubuntu发行版本号

  • /etc/issue文件是Linux系统开机启动时在命令行界面弹出的欢迎语句文件
  • Ubuntu中记录了发行版本名,但CentOS没有
sun@u20a:/root$ cat /etc/issue
Ubuntu 20.04.2 LTS \n \l
[root@C8-186 ~]# cat /etc/issue
\S
Kernel \r on an \m

lsb_release -a

  • lsb_release:prints certain LSB (Linux Standard Base) and Distribution information.
  • 专门用来查看当前系统的发行版信息的命令
  • Ubuntu默认已安装,但最小化安装CentOS没有安装
sun@u20a:/root$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal
  • CentOS需要额外安装软件包
[root@C8-186 ~]# lsb_release -a
-bash: lsb_release: command not found
[root@C8-186 ~]# yum -y install lsb_release
BaseOS                                                                                                                                      31 kB/s | 3.9 kB     00:00
AppStream                                                                                                                                   37 kB/s | 4.3 kB     00:00
EPEL                                                                                                                                        32 kB/s | 4.7 kB     00:00
extras                                                                                                                                      12 kB/s | 1.5 kB     00:00
centosplus                                                                                                                                  12 kB/s | 1.5 kB     00:00
No match for argument: lsb_release
Error: Unable to find a match: lsb_release
[root@C8-186 ~]# yum provides lsb_release
Last metadata expiration check: 0:00:16 ago on Tue 13 Jul 2021 07:05:20 PM CST.
redhat-lsb-core-4.1-47.el8.i686 : LSB Core module support
Repo        : AppStream
Matched from:
Filename    : /usr/bin/lsb_releaseredhat-lsb-core-4.1-47.el8.x86_64 : LSB Core module support
Repo        : AppStream
Matched from:
Filename    : /usr/bin/lsb_release[root@C8-186 ~]# yum -y install redhat-lsb-core-4.1-47.el8.x86_64
#……省略的安装信息
Installed:redhat-lsb-core-4.1-47.el8.x86_64      at-3.1.20-11.el8.x86_64            avahi-libs-0.7-20.el8.x86_64                       cups-libs-1:2.2.6-38.el8.x86_64          ed-1.14.2-4.el8.x86_64                 mailx-12.5-29.el8.x86_64           ncurses-compat-libs-6.1-7.20180224.el8.x86_64      patch-2.7.6-11.el8.x86_64                psmisc-23.1-5.el8.x86_64               spax-1.5.3-13.el8.x86_64           time-1.9-3.el8.x86_64                              util-linux-user-2.32.1-27.el8.x86_64     cups-client-1:2.2.6-38.el8.x86_64      liblockfile-1.14-1.el8.x86_64      redhat-lsb-submod-security-4.1-47.el8.x86_64       esmtp-1.2-15.el8.x86_64                  libesmtp-1.0.6-18.el8.x86_64          Complete!
[root@C8-186 ~]# lsb_release
LSB Version:    :core-4.1-amd64:core-4.1-noarch
[root@C8-186 ~]# 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

Ubuntu查看系统版本信息的方法汇总相关推荐

  1. linux查看vmware的版本,linux中查看系统版本信息的方法

    前言 测试环境:测试环境: centos7.2 64位 测试用户:root 查看系统位数(32位或64位) 方法1: [root@VM_0_13_centos ~]# uname -a Linux V ...

  2. Ubuntu查看系统版本信息

    下面写一下查看当前Linux系统的版本的方法 我使用3A服务器远程连接的机器,带宽又高又便宜 一.使用命令:cat /proc/version 查看 linux版本号:Linux version 5. ...

  3. linux查看系统版本信息命令

    几种查看Linux版本信息的方法: 1. uname -a 2. cat /proc/version 3. cat /etc/issue 4. lsb_release -a 详解 lsb_releas ...

  4. 几种查看linux版本信息的方法

    下面介绍几种查看linux版本信息的方法: 1)uname -a 2)cat /proc/version 3)cat /etc/issue

  5. Mac OS X 命令查看系统版本信息

    Mac 下使用 sw_vers 查看系统版本信息: gouwa@bbox:~$ sw_vers ProductName: Mac OS X ProductVersion: 10.7.2 BuildVe ...

  6. Linux下查看系统版本号信息的方法

    From:https://linux.cn/article-9586-1.html 如果你加入了一家新公司,要为开发团队安装所需的软件并重启服务,这个时候首先要弄清楚它们运行在什么发行版以及哪个版本的 ...

  7. Mac OS 查看系统版本信息/硬件信息的命令

    文章目录 一.查看硬盘信息 二.查看系统内核信息 三.查看 OS 版本信息 一.查看硬盘信息 liaowenxiongdeMacBook-Air:~ liaowenxiong$ system_prof ...

  8. linux(ubuntu) 查看系统设备信息 命令

    时间:2012-08-02 00:12 ubuntu查看版本命令 方法一: 在终端中执行下列指令: cat /etc/issue 方法二: 使用 lsb_release 命令也可以查看 Ubuntu ...

  9. 在Linux下查看系统版本信息命令总结

    每次在想查看系统是多少位的时候.总是记不清究竟用哪个命令.所以做个总结. vonzhou@de16-C6100:~$ lsb_release -a No LSB modules are availab ...

最新文章

  1. C++编程练习(5)----“实现简单的循环队列的顺序存储结构“
  2. ML之RFXGBoost:分别基于RF随机森林、XGBoost算法对Titanic(泰坦尼克号)数据集进行二分类预测(乘客是否生还)
  3. 每日一笑 | 大学教室的真实写照...
  4. 查询数据库中所有表名称
  5. @MapperScan和@ComponentScan的区别
  6. 她,18岁,李飞飞三度公开表扬,高中时NIPS获奖,创造「AI手术教练」
  7. WebRTC之linux ARM64交叉编译(七)
  8. visio2010安装
  9. 挥泪推荐6款非常非常非常实用的软件!
  10. 初中英语语法(014)-现在完成时
  11. 《传统相声开场小唱》
  12. CodeFroces GYM 2016-2017 ACM-ICPC, Egyptian Collegiate Programming Contest (ECPC 16) B.street(最短路)
  13. built a JNCIS LAB系列:Chapter 1 Routing Policy
  14. 关于阿里云服务器密码重置和使用方法
  15. 《第一桶金怎么赚——淘宝开店创业致富一册通》一一1.1 创业者需具备的素质...
  16. SAP中标准价和移动平均价的学习笔记
  17. 更新Android版GPS定位源代码
  18. 论文阅读:《Neural Machine Translation by Jointly Learning to Align and Translate》
  19. Vue报错:Error in v-on handler: “ReferenceError: regeneratorRuntime is not defined“
  20. 微信开发相关图书推荐

热门文章

  1. CityScapes数据集转voc数据格式训练yolov5(含下载链接)
  2. ubuntu搭建cups打印机服务器
  3. Java连载47-多态基础语法、作用
  4. 达不达标的公式计算机,“我面试了几百个大学生都不达标,发现他们连这3个Excel公式都看不懂!”...
  5. 2.11 Nginx控制浏览器缓存
  6. word撰写论文秘籍:图表自动编号、公式自动编号、自动页眉、自动参考文献
  7. mysql 条件分支_记mysql条件分支语句CASE WHEN THEN ELSE END的使用
  8. 王者荣耀账号转服务器,《王者荣耀》账号怎么转区 账号转区方法
  9. 锋迷商城项目数据库设计(四)
  10. 程序中有游离的...