Articles

9 Nützliche Befehle zum Abrufen von CPU-Informationen unter Linux

In einem früheren Artikel haben wir eine Liste von 10 nützlichen Befehlen zum Sammeln von System-und Hardwareinformationen unter Linux zusammengestellt. In diesem Handbuch werden wir uns auf die CPU/den Prozessor beschränken und Ihnen verschiedene Möglichkeiten zum Extrahieren detaillierter Informationen zu Ihrer Maschinen-CPU zeigen.

Um Ihnen einen Überblick zu geben, fragen wir Informationen wie CPU-Architektur, vendor_id, Modell, Modellname, Anzahl der CPU-Kerne, Geschwindigkeit jedes Kerns und vieles mehr ab.,
Im Wesentlichen enthält die /proc/cpuinfo diese alle Informationen, jeder andere Befehl/Dienstprogramm bekommt seine Ausgabe aus dieser Datei.

Mit dieser sagte, unten sind 9 befehle für immer informationen über ihre Linux CPU.,

Get CPU Info Mit Hilfe von cat-Befehl

Sie können einfach Ansicht die Informationen der system-CPU mit der Anzeige der Inhalte von /proc/cpuinfo-Datei mit Hilfe des cat-Befehls wie folgt:

$ cat /proc/cpuinfo
Linux CPU-Informationen
processor: 0vendor_id: GenuineIntelcpu family: 6model: 69model name: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHzstepping: 1microcode: 0x1ccpu MHz: 1700.062cache size: 3072 KBphysical id: 0siblings: 4core id: 0cpu cores: 2apicid: 0initial apicid: 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 dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln ptsbugs:bogomips: 4788.92clflush size: 64cache_alignment: 64address sizes: 39 bits physical, 48 bits virtualpower management:......

, Um ein wenig spezifisch, Sie verwenden können die grep-Befehl – a CLI tool for searching plain-text data for lines matching a regular expression.,sted Lesen: Wie zu Verwenden ‚cat‘ und ‚tac‘ Befehle mit Beispiele in Linux

lscpu Befehl – Zeigt CPU Architektur Informationen

Der befehl lscpu druckt CPU architektur informationen von sysfs und /proc/cpuinfo wie unten gezeigt:

$ lscpu
Linux CPU Architecture
Architecture: x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s): 4On-line CPU(s) list: 0-3Thread(s) per core: 2Core(s) per socket: 2Socket(s): 1NUMA node(s): 1Vendor ID: GenuineIntelCPU family: 6Model: 69Model name: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHzStepping: 1CPU MHz: 1303.687CPU max MHz: 2700.0000CPU min MHz: 800.0000BogoMIPS: 4788.92Virtualization: VT-xL1d cache: 32KL1i cache: 32KL2 cache: 256KL3 cache: 3072KNUMA node0 CPU(s): 0-3Flags: 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 arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts

cpuid Command – Zeigt x86 CPU

Der Befehl cpuid Dumps vollständige Informationen über die CPU(s) aus der CPUID Anweisung gesammelt, und entdecken Sie auch das genaue Modell der x86 CPU(s) von diesen Informationen.,

Stellen Sie sicher, dass Sie es installieren, bevor Sie es ausführen.

$ sudo apt install cpuid #Debian/Ubuntu systems$ sudo yum install cpuid#RHEL/CentOS systems $ sudo dnf install cpuid#Fedora 22+ 

Führen Sie nach der Installation cpuid aus, um Informationen zur x86-CPU zu sammeln.

$ cpuid
Zeigt x86 CPU Informationen

dmidecode Befehl – Zeigt Linux Hardware Informationen

dmidecode ist ein werkzeug für abrufen hardware informationen von jedem Linux system. Es Dumps eines Computers DMI (auch bekannt als SMBIOS) Tabelleninhalt in einem lesbaren Format für den einfachen Abruf., Die SMBIOS spezifikation definiert verschiedene DMI typen, für CPU, verwenden „prozessor“wie folgt:

$ sudo dmidecode --type processor
Zeigt Linux Hardware Informationen
# dmidecode 3.0Getting SMBIOS data from sysfs.SMBIOS 2.7 present.Handle 0x0004, DMI type 4, 42 bytesProcessor InformationSocket Designation: U3E1Type: Central ProcessorFamily: Core i5Manufacturer: Intel(R) CorporationID: 51 06 04 00 FF FB EB BFSignature: Type 0, Family 6, Model 69, Stepping 1Flags:FPU (Floating-point unit on-chip)VME (Virtual mode extension)DE (Debugging extension)PSE (Page size extension)TSC (Time stamp counter)MSR (Model specific registers)PAE (Physical address extension)MCE (Machine check exception)CX8 (CMPXCHG8 instruction supported)APIC (On-chip APIC hardware supported)SEP (Fast system call)MTRR (Memory type range registers)PGE (Page global enable)MCA (Machine check architecture).....

Inxi Werkzeug – Zeigt Linux System Informationen

Inxi ist eine leistungsstarke befehl-linie system informationen skript bestimmt sowohl konsole und IRC (Internet Relay Chat). Sie können damit sofort Hardwareinformationen abrufen.,

Sie können wie folgt installieren:

$ sudo apt install inxi #Debian/Ubuntu systems$ sudo yum install inxi#RHEL/CentOS systems $ sudo dnf install inxi#Fedora 22+ 

Um vollständige CPU-Informationen anzuzeigen, einschließlich pro CPU – Taktrate und CPU-Höchstgeschwindigkeit (falls verfügbar), verwenden Sie das Flag -C wie folgt:

$ inxi -C
Linux-Systeminformationen drucken
CPU: Dual core Intel Core i5-4210U (-HT-MCP-) cache: 3072 KB clock speeds: max: 2700 MHz 1: 1958 MHz 2: 1993 MHz 3: 1775 MHz 4: 1714 MHz

lshw Tool-List Hardwarekonfiguration

lshw ist ein minimales Tool zum Sammeln eingehender Informationen zur Hardwarekonfiguration eines Computers.,ist der Fall:

$ sudo lshw -C CPU
Linux – Hardwarekonfiguration drucken
*-cpu description: CPU product: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz vendor: Intel Corp. physical id: 4 bus info: cpu@0 version: Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz serial: To Be Filled By O.E.M. slot: U3E1 size: 2626MHz capacity: 2700MHz width: 64 bits clock: 100MHz capabilities: x86-64 fpu fpu_exception wp 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 constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts cpufreq configuration: cores=2 enabledcores=2 threads=4

hardinfo-Zeigt Hardwareinformationen im GTK+ – Fenster an

hardinfo zeigt Hardwareinformationen in einem GTK+ – Fenster an, Sie können es wie folgt installieren:

$ sudo apt install hardinfo #Debian/Ubuntu systems$ sudo yum install hardinfo#RHEL/CentOS systems $ sudo dnf install hardinfo#Fedora 22+ 

Sobald Sie es installiert haben, geben Sie Folgendes ein:

$ hardinfo 
Linux System Information

Außerdem können Sie durch Klicken auf die Schaltfläche „Bericht generieren“ einen Systemhardwareinfo-Bericht generieren., Klicken Sie in der folgenden Benutzeroberfläche auf „Generieren“, um fortzufahren. Beachten Sie, dass Sie die Kategorie Hardware-Informationen auswählen können, die generiert werden soll.

Systeminformationsbericht generieren

Sobald Sie den Bericht im HTML-Format erstellt haben, können Sie ihn wie unten gezeigt über einen Webbrowser anzeigen.,

Linux System Detailed Information

hwinfo – Shows Present Hardware Info

hwinfo is used to extract info about the hardware present in a Linux system.,mmand wird verwendet, um die Anzahl der auf Ihrem Computer vorhandenen Verarbeitungseinheiten anzuzeigen:

$ nproc

Lesen Sie die Manpages dieser Befehle wie folgt durch:

$ man commandname

Lesen Sie auch:

  1. Cpustat – Überwacht die CPU – Auslastung durch Ausführen von Prozessen unter Linux
  2. CoreFreq-Ein leistungsstarkes CPU-Überwachungstool für Linux-Systeme
  3. Finden Sie die am besten laufenden Prozesse nach der höchsten Speicher-und CPU-Auslastung in Linux
  4. Wie man Linux mit dem ‚Stress-ng‘ – Tool eine hohe CPU-Auslastung und einen Stresstest auferlegt

Das war ‚ s vorerst!, Sie können zusätzliche Möglichkeiten zum Extrahieren von CPU-Informationen in Linux über das Feedback-Formular unten mit uns teilen.