Linux命令:查看os和cpu信息

来源:互联网 发布:2016宽带网络建设 编辑:程序博客网 时间:2024/05/17 02:14

1.查看操作系统位数:

wyj@arch-node3:~$ getconf LONG_BIT
如果为64位,则显示

64
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2.查看cpu硬件架构

Linux中使用命令arch可以初步查看出当前系统所识别出来的机器CPU类型,

wyj@arch-node3:~$ arch
x86_64

表示x86微处理器架构,为64

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

3显示系统的信息

wyj@arch-node3:~$ uname -a

我的机器显示如下:
Linux arch-node3 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
含义:

Linux:每个执行uname命令的第一个字段都是它(除非你用的是Solaris或者AIX

arch-node3:所在主机的主机名,与主机配置文件/etc/hosts内容一致

3.5.0-17-generic #28-Ubuntu:内核版本号

SMP:对称式多处理器

Tue Oct 9 19:31:23 UTC 2012:系统启动时间

x86_64cpu指令集

x86_64

x86_64cpu架构

GNU/Linux:该Linux版本符合GNU

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

wyj@arch-node3:~$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
 显示:

16 Intel(R) Xeon(R) CPU E5620 @ 2.40GHz


 16 :逻辑核数

Intel(R) Xeon(R) CPU :处理器

E5620 :型号

@ 2.40GHz:主频
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

注意16指的是逻辑核数,intel使用超线程的技术,可以从一个物理核上分出多个逻辑核(我的机器是每个物理核分出4个逻辑核),要看实际的物理核数,可以使用下列命令

wyj@arch-node3:~$ cat /proc/cpuinfo

显示如下:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm arat epb dtherm tpr_shadow vnmi flexpriority ept vpid
bogomips : 4800.06
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
其中processor : 0表示逻辑处理器的标号,本机器一直编号到15

cpu cores : 4 表示物理核数为4