查看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 \n \
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

posted @ 2019-09-27 16:45  钟灵.毓秀  阅读(859)  评论(0编辑  收藏  举报