Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method to view the linux system configuration

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces in detail the method of viewing the linux system configuration. The sample code in this article is very detailed and has a certain reference value. Interested friends can refer to it.

How to view the linux system configuration:

CPU

1. Lscpu: displays cpu schema information

[xxx@localhost ~] $lscpuArchitecture: x86_64CPU op-mode (s): 32-bit, 64-bitByte Order: Little EndianCPU (s): 4 # Total number of processor cores On-line CPU (s) list: 0-3Thread (s) per core: 1 # number of threads supported per core. 1 indicates that only one thread is supported That is, hyperthreading Core (s) per socket: 1 # number of cores per processor Socket (s): 4 # processors number of NUMA node (s): 1Vendor ID: GenuineIntelCPU family: 6Model: 63Stepping: 0CPU MHz: 2599.998BogoMIPS: 5199.99Hypervisor vendor: VMware # hypervisor vendor Virtualization type: fullL1d cache: 32KL1i cache: 32KL2 cache: 256KL3 cache: 30720KNUMA node0 CPU (s): 0-3

Total processor cores = number of processors * number of cores per processor * number of threads supported per core. Namely: CPU (s) = Socket (s) * Core (s) * Thread (s).

2. Cat / proc/cpuinfo: view CPU details

[xxx@localhost ~] $cat / proc/cpuinfo processor: 0vendor_id: GenuineIntelcpu family: 6model: 63model name: Intel (R) Xeon (R) CPU E5-2690 v3 @ 2.60GHzstepping: 0cpu MHz: 2599.998cache size: 30720 KBfpu: yesfpu_exception: yescpuid level: 13wp: yesflags: fpu vme de pse tsc Msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtsbogomips: 5199.99clflush size: 64cache_alignment: 64address sizes: 40 bits physical 48 bits virtualpower management:processor: 1vendor_id: GenuineIntelcpu family: 6model: 63model name: Intel (R) Xeon (R) CPU E5-2690 v3 @ 2.60GHzstepping: 0cpu MHz: 2599.998cache size: 30720 KBfpu: yesfpu_exception: yescpuid level: 13wp: yesflags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr Pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtsbogomips: 5199.99clflush size: 64cache_alignment: 64address sizes: 40 bits physical 48 bits virtualpower management:processor: 2vendor_id: GenuineIntelcpu family: 6model: 63model name: Intel (R) Xeon (R) CPU E5-2690 v3 @ 2.60GHzstepping: 0cpu MHz: 2599.998cache size: 30720 KBfpu: yesfpu_exception: yescpuid level: 13wp: yesflags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr Pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtsbogomips: 5199.99clflush size: 64cache_alignment: 64address sizes: 40 bits physical 48 bits virtualpower management:processor: 3vendor_id: GenuineIntelcpu family: 6model: 63model name: Intel (R) Xeon (R) CPU E5-2690 v3 @ 2.60GHzstepping: 0cpu MHz: 2599.998cache size: 30720 KBfpu: yesfpu_exception: yescpuid level: 13wp: yesflags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr Pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtsbogomips: 5199.99clflush size: 64cache_alignment: 64address sizes: 40 bits physical 48 bits virtualpower management:

If you output in this way, there will be a lot of content and it will look a little confusing. We can use several commands to see what we want to know:

# View the number of physical CPU cat / proc/cpuinfo | grep "physical id" | sort | uniq# view the number of core in each physical CPU (that is, the number of cores) cat / proc/cpuinfo | grep "cpu cores" | uniq# view the number of threads in each physical CPU | grep "siblings" | uniq# view the number of logical CPU cat / proc/cpuinfo | grep "processor" # View CPU model cat / proc/cpuinfo | grep "model name" | uniq

Memory

Check / proc/meminfo or use the free command. The free command is the information obtained from meminfo. In general, we can get what we want to know by using free:

[xxx@localhost] $free-m total used free shared buffers cachedMem: 7868 954 6914 0 64 619 buffers/cache + buffers/cache: 271 7597Swap: 4031 0 4031

As you can see, the memory size is 8G.

Hard disk

1. Lsblk:blk is the abbreviation of block. List block devices

[xxx@localhost ~] $lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsr0 11:0 1 1024M 0 rom sdb 8:16 0100G 0 disk └─ sdb1 8:17 0100G 0 part / datasda 8:0 060G 0 disk ├─ sda1 8:1 0 500M 0 part / boot └─ sda2 8:2 059.5G 0 part ├─ VolGroup-lv_root (dm-0) 253├─ 050G 0 lvm / ├─ VolGroup-lv_swap (dm-1) 253└─ 1 04G 0 lvm [SWAP] └─ VolGroup-lv_home (dm-2) 253G05.6G 0 lvm / home

Where TYPE=disk represents the hard disk. As you can see, the hard disk is divided into sda and sdb, a total of 160g.

2. Df: view hard disk usage

[xxx@localhost] $df-hFilesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root 50G 1.7G 46G 4% / tmpfs 3.9G 0 3.9G 0% / dev/shm/dev/sda1 485M 39M 421m 9% / boot/dev/mapper/VolGroup-lv_home 5.5G 165m 5.1G 4% / home/dev/sdb1 99G 188m 94G 1% / data

The Size of all lines can be added up to calculate the size of the hard disk.

What is the method of viewing the linux system configuration is shared here, of course, not only the above and everyone analysis methods, but the editor can ensure its accuracy is absolutely no problem. I hope that the above content can have a certain reference value for everyone, and can be put into practice. If you like this article, you might as well share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report