辨识标准
首先要清楚什么样标识是32位的,什么样的是64位的。
PC server X86 系列
I386--I686 都是32位
x86_64 是 64位
命令实在是不要太多,为了防止选择性障碍,一致选择第一种方式,后面的仅作为补充。
查看系统位数 方法1:
[root@localhost bob]# uname -aLinux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
方法2:显示系统程序信息
[root@localhost bob]# file /bin/ls/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=c5ad78cfc1de12b9bb6829207cececb990b3e987, stripped
方法3:
[root@localhost bob]# cat /proc/versionLinux version 3.10.0-862.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018
查看系统版本
方法1:
[root@localhost bob]# cat /etc/os-releaseNAME="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"
方法2:查看具体版本
[root@localhost bob]# cat /etc/redhat-releaseCentOS Linux release 7.5.1804 (Core)
方法3:
[root@localhost bob]# rpm -q centos-releasecentos-release-7-5.1804.el7.centos.x86_64
查看内核版本
方法1:
[root@localhost bob]# cat /proc/versionLinux version 3.10.0-862.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018
方法2:
[root@localhost bob]# uname -aLinux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux