##查看系统版本
方法1
[[email protected] ~]$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
方法2
[[email protected] ~]$ lsb_release -a
-bash: lsb_release: command not found
[[email protected] ~]$ cat /etc/os-release
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"
##查看Linux系统32位or 64位
[[email protected] ~]# uname –m
x86_64 //64位系统
i386/i686 //32位系统
##查看Linux系统的内核版本
[[email protected] ~]# uname –r
2.6.32-504.e16.x86_64
##查看Linux系统全部信息
[[email protected] ~]# uname -a
Linux moban 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
##显示系统程序信息
[[email protected] ~]$ 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]=3d705971a4c4544545cb78fd890d27bf792af6d4, stripped
原文地址:http://blog.51cto.com/wdf1002/2113403