• 查看linux系统版本相关信息


    1.查看内核版本:cat /proc/version

    A机器
    root@debian:~# cat /proc/version
    Linux version 3.10.102-2-686 (ty@debian) (gcc version 4.7.2 (Debian 4.7.2-5) ) #1 SMP Sat Sep 17 21:47:55 EDT 2016
    B机器
    [root@bogon ~]# cat /proc/version
    Linux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018

    2.查看发行版本信息  cat /etc/*-release   或   cat /etc/issue

     A机器

    root@debian:~# cat /etc/*-release
    PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
    NAME="Debian GNU/Linux"
    VERSION_ID="7"
    VERSION="7 (wheezy)"
    ID=debian
    ANSI_COLOR="1;31"
    HOME_URL="http://www.debian.org/"
    SUPPORT_URL="http://www.debian.org/support/"
    BUG_REPORT_URL="http://bugs.debian.org/"
    root@debian:~# cat /etc/issue
    Debian GNU/Linux 7 
     
    B机器
    [root@bogon ~]# cat /etc/*-release
    CentOS Linux release 7.6.1810 (Core) 
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"
    
    CENTOS_MANTISBT_PROJECT="CentOS-7"
    CENTOS_MANTISBT_PROJECT_VERSION="7"
    REDHAT_SUPPORT_PRODUCT="centos"
    REDHAT_SUPPORT_PRODUCT_VERSION="7"
    
    CentOS Linux release 7.6.1810 (Core) 
    CentOS Linux release 7.6.1810 (Core) 

     从上面信息可以分析出

    A机器:Debian 7 x86; B机器:CentOS 7 x86_64

  • 相关阅读:
    操作系统原理
    Linux三剑客正则表达式
    Linux通配符知识深度实践详解
    Linux文件属性之时间戳及文件名知识详解
    Linux系统文件权限
    date:显示与设置系统时间
    正则表达式--三剑客简单应用
    Linux习题小结
    Linux系统文件属性知识
    Linux系统目录结构知识
  • 原文地址:https://www.cnblogs.com/sylvia-liu/p/11598880.html
Copyright © 2020-2023  润新知