查看Linux系统信息

1.查看内核

[root@localhost etc]# uname -a
Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


[root@localhost etc]# uname -r
3.10.0-514.el7.x86_64

[root@localhost etc]# cat /proc/version 
Linux version 3.10.0-514.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Nov 22 16:42:41 UTC 2016

2.查看发行版信息

[root@lvs-slave ~]# cat /etc/issue

CentOS release 6.7 (Final)
Kernel on an m


[root@localhost etc]# cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)


[root@localhost etc]# cat /etc/os-release |grep VERSION
VERSION="7 (Core)"
VERSION_ID="7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT_VERSION="7"


[root@localhost etc]# lsb_release -a      前提是安装这个命令,yum install redhat-lsb,安装包很多,将近80M
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core) 
Release: 7.3.1611
Codename: Core


3.查看cpu信息

[root@localhost etc]# cat /proc/cpuinfo 

4.查看是64位还是32位
[root@localhost etc]# getconf LONG_BIT
64


[root@localhost etc]# 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

原文地址:https://www.cnblogs.com/fanren224/p/8457216.html