Linux内核如何查看cpu位数,查看linux系统内核、CPU内存、系统位数的相关命令

查看linux系统内核、CPU内存、系统位数的相关命令

以我的笔记本为例,看看相关命令。

HP-NX6120,赛扬1.5G,2根内存条(1G + 512M),操作系统Ubuntu8.04。

查看Linux版本、内核

~$ cat /etc/issue

Ubuntu 8.04.3 LTS \n \l

~$ cat /proc/version

Linux version 2.6.24-26-generic (buildd@vernadsky) (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)) #1 SMP Tue Dec 1 18:37:31 UTC 2009

~$ uname -r

2.6.24-26-generic

查看CPU

在我的赛扬CPU笔记本上:

~$ cat /proc/cpuinfo

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 13

model name : Intel(R) Celeron(R) M processor 1.50GHz

stepping : 8

cpu MHz : 1499.869

cache size : 1024 KB

fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : yes

cpuid level : 2

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up bts

bogomips : 2999.73

clflush size : 64

在一台PC服务器上(双U双核):

~$ cat /proc/cpuinfo

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 15

model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz

stepping : 6

cpu MHz : 2000.070

cache size : 4096 KB

physical id : 0

siblings : 2

core id : 0

cpu cores : 2

fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : yes

cpuid level : 10

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr

bogomips : 4004.56

processor : 1

vendor_id : GenuineIntel

cpu family : 6

model : 15

model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz

stepping : 6

cpu MHz : 2000.070

cache size : 4096 KB

physical id : 0

siblings : 2

core id : 1

cpu cores : 2

fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : yes

cpuid level : 10

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr

bogomips : 4000.02

processor : 2

vendor_id : GenuineIntel

cpu family : 6

model : 15

model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz

stepping : 6

cpu MHz : 2000.070

cache size : 4096 KB

physical id : 3

siblings : 2

core id : 6

cpu cores : 2

fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : yes

cpuid level : 10

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr

bogomips : 4000.08

processor : 3

vendor_id : GenuineIntel

cpu family : 6

model : 15

model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz

stepping : 6

cpu MHz : 2000.070

cache size : 4096 KB

physical id : 3

siblings : 2

core id : 7

cpu cores : 2

fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : no

fpu : yes

fpu_exception : yes

cpuid level : 10

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr

bogomips : 4000.12

可以过滤一下:

~$ grep "model name" /proc/cpuinfo

model name : Intel(R) Celeron(R) M processor 1.50GHz

多U多核的环境中查看CPU物理个数:

~$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

多U多核的环境中查看CPU核数:

~$ cat /proc/cpuinfo | grep "cores" | uniq

查看内存

~$ cat /proc/meminfo

MemTotal: 1547292 kB

MemFree: 82216 kB

Buffers: 74720 kB

Cached: 895940 kB

SwapCached: 0 kB

Active: 712544 kB

Inactive: 599772 kB

HighTotal: 646976 kB

HighFree: 1116 kB

LowTotal: 900316 kB

LowFree: 81100 kB

SwapTotal: 979924 kB

SwapFree: 979924 kB

Dirty: 84 kB

Writeback: 0 kB

AnonPages: 341708 kB

Mapped: 83216 kB

Slab: 80324 kB

SReclaimable: 67092 kB

SUnreclaim: 13232 kB

PageTables: 2936 kB

NFS_Unstable: 0 kB

Bounce: 0 kB

CommitLimit: 1753568 kB

Committed_AS: 886988 kB

VmallocTotal: 114680 kB

VmallocUsed: 6852 kB

VmallocChunk: 107508 kB

可以过滤一下:

~$ grep MemTotal /proc/meminfo

MemTotal: 1547292 kB

查看系统位数

当前的Linux计算机,基本上就是32位或64位之分,可以通过查看long整形的位数确定,看看是32位还是64位:

~$ getconf LONG_BIT

32

喜欢本文

阅读(685) | 评论(0) | 转发(0) |

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值