centos系统查看系统版本、内核版本、系统位数、cpu个数、核心数、线程数

centos查看系统版本

cat /etc/redhat-release

CentOS Linux release 7.2.1511 (Core) 

1)查看centos内核的版本:

[root@localhost ~]#  cat  /proc/version

Linux version 2.6.18-194.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))

#1 SMP Fri Apr 2 14:58:14 EDT 2010

2)显示系统名、节点名称、操作系统的发行版号、操作系统版本、运行系统的机器 ID 号

[root@localhost ~]# uname -a

Linux localhost.localdomain 2.6.18-194.el5 

#1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

3)显示操作系统的发行版号

[root@localhost ~]# uname -r

2.6.18-194.el5

查看linux版本:

  1. 列出所有版本信息,
[root@localhost ~]# lsb_release -a

LSB Version:     core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch

Distributor ID:   CentOS

Description:      CentOS release 5.5 (Final)

Release:          5.5

Codename:      Final

注:这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。

  1. 执行cat /etc/issue,例如如下:
[root@localhost ~]# cat /etc/issue

CentOS release 5.5 (Final)

Kernel r on an m
  1. 执行cat /etc/redhat-release ,例如如下:
[root@localhost ~]# cat /etc/redhat-release

CentOS release 5.5 (Final)

查看系统是64位还是32位:

[root@localhost ~]#  getconf LONG_BIT

64

2、file /bin/ls

[root@localhost ~]# file /bin/ls

/bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

3、lsb_release -a

[root@localhost ~]# lsb_release -a

LSB Version:    :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch

Distributor ID: CentOS

Description:    CentOS release 5.5 (Final)

Release:        5.5

Codename:       Final

centos查看系统cpu个数、核心数、线程数

1.查看物理cpu个数

grep 'physical id' /proc/cpuinfo | sort -u | wc -l    

2

2.查看核心数量,即每个物理CPU中core的个数(即核数)

grep 'core id' /proc/cpuinfo | sort -u | wc -l

6

3.查看线程数(逻辑CPU的个数)

grep 'processor' /proc/cpuinfo | sort -u | wc -l 

24

4.查看cpu型号

dmidecode -s processor-version

5.查看内存方法

grep MemTotal /proc/meminfo

# 总核数 = 物理CPU个数 X 每颗物理CPU的核数
# 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数

# 查看物理CPU个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
   2

# 查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo| grep "cpu cores"| uniq
   6

# 查看逻辑CPU的个数
cat /proc/cpuinfo| grep "processor"| wc -l
  24

详细物理cpu,核数,逻辑cpu说明

http://blog.csdn.net/u011630575/article/details/61194094

上一篇:卸载mysql后再安装提示The service already exists!问题解决方法


下一篇:C#中DateTime.Ticks属性及Unix时间戳转换