Página 1 de 1

Mostrar información de la CPU con la terminal

Publicado: 21 Jun 2024, 12:56
por Guillermo
Comandos Linux para consultar hardware

- lscpu: display information about the CPU architecture
El archivo /proc/cpuinfo contiene información detallada sobre el procesador de un sistema. Desgraciadamente, los detalles no son amigables para los usuarios generales. Se puede obtener un resultado más general con el comando lscpu:

Código: Seleccionar todo

guillermo@maquina:~$ lscpu
Arquitectura:                            x86_64
  modo(s) de operación de las CPUs:      32-bit, 64-bit
  Tamaños de las direcciones:            39 bits physical, 48 bits virtual
  Orden de los bytes:                    Little Endian
CPU(s):                                  4
  Lista de la(s) CPU(s) en línea:        0-3
ID de fabricante:                        GenuineIntel
  Nombre del modelo:                     Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz
    Familia de CPU:                      6
    Modelo:                              60
    Hilo(s) de procesamiento por núcleo: 2
    Núcleo(s) por «socket»:              2
    «Socket(s)»:                         1
    Revisión:                            3
    CPU(s) scaling MHz:                  22%
    CPU MHz máx.:                        3600,0000
    CPU MHz mín.:                        800,0000
    BogoMIPS:                            7183,98
    Indicadores:                         fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fx
                                         sr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_go
                                         od nopl xtopology nonstop_tsc cpuid aperfmperf 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 cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi
                                          flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dth
                                         erm arat pln pts md_clear flush_l1d
Características de virtualización:
  Virtualización:                        VT-x
Cachés (suma de todas):
  L1d:                                   64 KiB (2 instancias)
  L1i:                                   64 KiB (2 instancias)
  L2:                                    512 KiB (2 instancias)
  L3:                                    3 MiB (1 instancia)
NUMA:
  Modo(s) NUMA:                          1
  CPU(s) del nodo NUMA 0:                0-3
Vulnerabilidades:
  Gather data sampling:                  Not affected
  Itlb multihit:                         KVM: Mitigation: VMX disabled
  L1tf:                                  Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
  Mds:                                   Mitigation; Clear CPU buffers; SMT vulnerable
  Meltdown:                              Mitigation; PTI
  Mmio stale data:                       Unknown: No mitigations
  Reg file data sampling:                Not affected
  Retbleed:                              Not affected
  Spec rstack overflow:                  Not affected
  Spec store bypass:                     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:                            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:                            Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP conditional; RSB filling; PBRSB-eIBRS
                                         Not affected; BHI Not affected
  Srbds:                                 Mitigation; Microcode
  Tsx async abort:                       Not affected
Man lscpu: (página del manual de lscpu)

Código: Seleccionar todo

guillermo@maquina:~$ man lscpu
NAME
lscpu - display information about the CPU architecture

SYNOPSIS
lscpu [options]

DESCRIPTION
lscpu gathers CPU architecture information from sysfs, /proc/cpuinfo and any applicable architecture-specific libraries (e.g.
librtas on Powerpc). The command output can be optimized for parsing or for easy readability by humans. The information
includes, for example, the number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access (NUMA) nodes. There is also
information about the CPU caches and cache sharing, family, model, bogoMIPS, byte order, and stepping.

The default output formatting on terminal is subject to change and maybe optimized for better readability. The output for
non-terminals (e.g., pipes) is never affected by this optimization and it is always in "Field: data\n" format. Use for
example "lscpu | less" to see the default output without optimizations.

In virtualized environments, the CPU architecture information displayed reflects the configuration of the guest operating
system which is typically different from the physical (host) system. On architectures that support retrieving physical
topology information, lscpu also displays the number of physical sockets, chips, cores in the host system.

Options that result in an output table have a list argument. Use this argument to customize the command output. Specify a
comma-separated list of column labels to limit the output table to only the specified columns, arranged in the specified
order. See COLUMNS for a list of valid column labels. The column labels are not case sensitive.

Not all columns are supported on all architectures. If an unsupported column is specified, lscpu prints the column but does
not provide any data for it.

The cache sizes are reported as summary from all CPUs. The versions before v2.34 reported per-core sizes, but this output was
confusing due to complicated CPUs topology and the way how caches are shared between CPUs. For more details about caches see
--cache. Since version v2.37 lscpu follows cache IDs as provided by Linux kernel and it does not always start from zero.

OPTIONS
-a, --all
Include lines for online and offline CPUs in the output (default for -e). This option may only be specified together with
option -e or -p.

-B, --bytes
Print the sizes in bytes rather than in a human-readable format.

By default, the unit, sizes are expressed in, is byte, and unit prefixes are in power of 2^10 (1024). Abbreviations of
symbols are exhibited truncated in order to reach a better readability, by exhibiting alone the first letter of them;
examples: "1 KiB" and "1 MiB" are respectively exhibited as "1 K" and "1 M", then omitting on purpose the mention "iB",
which is part of these abbreviations.

-b, --online
Limit the output to online CPUs (default for -p). This option may only be specified together with option -e or -p.

-C, --caches[=list]
Display details about CPU caches. For details about available information see --help output.

If the list argument is omitted, all columns for which data is available are included in the command output.