【Linux-shell】一些CPU的命令

1、linux CPU信息

alexliu-ubuntu@hadoop001:~$ cat /proc/cpuinfo | grep name | cut -f2 -d:| uniq -c
      4  Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
     
alexliu-ubuntu@hadoop001:~/$  cat /proc/cpuinfo |grep "model name" && cat /proc/cpuinfo |grep "physical id"
model name	: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
model name	: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
model name	: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
model name	: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
physical id	: 0
physical id	: 0
physical id	: 0
physical id	: 0

2、内存大小

alexliu-ubuntu@hadoop001:~$ cat /proc/meminfo |grep MemTotal
MemTotal:        8066808 kB

3、硬盘大小

alexliu-ubuntu@hadoop001:~$ sudo fdisk -l |grep Disk
sudo: unable to resolve host hadoop001
Partition 1 does not start on physical sector boundary.
Partition 3 does not start on physical sector boundary.
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disklabel type: dos
Disk identifier: 0x9e0a7ddb

4、查看当前操作系统的内核信息

alexliu-ubuntu@hadoop001:~$ uname -a
Linux hadoop001 4.4.0-145-generic #171-Ubuntu SMP Tue Mar 26 12:43:40 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

5、查看系统的内存位数

alexliu-ubuntu@hadoop001:~$ getconf LONG_BIT 
64

6、查看CPU信息的linux系统信息命令

alexliu-ubuntu@hadoop001:~$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 94
model name	: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
stepping	: 3
microcode	: 0xc6
cpu MHz		: 2600.125
cache size	: 6144 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
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 art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb invpcid_single intel_pt ssbd ibrs ibpb stibp kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp flush_l1d
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 6384.17
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:
....

你可能感兴趣的:(Linux)