【Linux-shell】CPUのコマンド

6207 ワード

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、現在のOSのカーネル情報を表示する

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:
....