How does Linux view CPU memory and system version?

12-19-2023

Linux to view CPU memory and system version 1. There are many ways to view CPU information, and we will deal with them in two situations here.

1.1 check the basic hardware information of CPU [whb @ VM _ 0 _ 12 _ centost] $ cat/proc/CPU info processor: 0 vendor _ id: genuine Intel CPU family: 6 model: 79 model name: Intel (r) Xeon (r). CPU E5-26xx v4stepping : 1microcode : 0x1cpu MHz : 2399.996cache size : 4096 KBphysical id : 0siblings : 1core id : 0cpu cores : 1apicid : 0initial ap icid : 0fpu : yesfpu_exception : yescpuid level : 13wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline _timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch bmi1 avx2 bmi2 rdseed adx xsaveoptbogomips : 4799.99clflush size : 64cache_alignment : 64address sizes :

1.2 check the CPU usage information, top && dstat# method 1 [whb @ VM _ 0 _ 12 _ centost] $ top # enter top to check the CPU usage, you can enter 1 to check the multi-core CPU usage. Asks: 74 total, 2 running, 72 sleeping, 0 stopped, 0 zombie%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 stKiB Mem : 1882892 total, 148092 free, 403032 used, 1331768 buff/cacheKiB Swap: 0 total, 0 free, 0 used. 1274708 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3677 root 20 0 162348 10684 1364 S 1.1 0.6 91:47.96 barad_agent 3678 r oot 20 0 611460 13444 1484 S 1.1 0.7 462:59.39 barad_agent 1 root 20 0 51644 3056 1840 S 0.0 0.2 12:14.31 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.66 k Threadd3root 200000s0.00 0.02: 00.04 ksoftirqd/0 # Method 2 [WHB @ VM _ 0 _ 12 _ centost] $ dstat-c # does not exist, and it can be installed on centos using yum -y install dstat.

2. There are many ways to view memory information, and we also deal with it in two situations here.

2.1 check the basic memory capacity information [whb @ VM _ 0 _ 12 _ centost] $ cat/proc/meminfo memtotal: 1882892kbMemFree: 147760kbMemAvailable: 1275048kbBuffers: 165600kbCached: 878652kbSwapcached: 0kbActive: 8998. ...

2.2 check the memory running space information [whb @ VM _ 0 _ 12 _ centost] $ free total used free shared buff/ cache availableMem: 1882892 403124 146836 544 1332932 1274648Swap: 0 0 0[whb@VM_0_12_centos test]$ free -k # Total used free shared buff/cache available mem: 1882892 402988 146964 544 1332940 1274788 swap: 000 [WHB @ VM _ 0 _ 12 _ centost] $ free-m # Total used free is displayed in MB.

3. View Linux to view the system version [WHB @ VM _ 0 _ 12 _ centostest] $ UNAME-A Linux VM _ 0 _ 12 _ centos3.10.0-862.el7.x86 _ 64 # 1 SMP FRIARP 20 16: 44: 24 UTC 2018 x86 _ 64 x86 _ 64 x86 _ 64 GNU/Linux [WHB @ VM _ 0 _ 12 _ centostest] $ cat/etc/red hat-release # If it is a centos machine, you can directly check the more detailed version of centos Linux Release 7.5.1804.

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us