LSCPU(1)
๐ป LSCPU(1) โ the glow-up guide to your CPU ๐
okay bestie, welcome to lscpu, the user command that tells you literally everything about your CPU architecture. No cap, she's the main character of /proc. Let's go. ๐ฆ
โจ NAME โจ
lscpu โ display information about the CPU architecture. That's it. That's the whole vibe. ๐ธ
๐ SYNOPSIS ๐
lscpu [options]
๐ DESCRIPTION ๐
So like, lscpu goes out and gathers CPU architecture info from sysfs, /proc/cpuinfo, and any applicable architecture-specific libraries (for example librtas on Powerpc). Then she curates it. The command output can be optimized either for parsing or for easy readability by humans โ your choice, queen. ๐
The info she serves includes, for example, the number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access (NUMA) nodes. She's also got the tea on CPU caches and cache sharing, family, model, bogoMIPS, byte order, stepping, and microcode version. All of it. Not gatekeeping a single crumb. ๐
Now, important: the default output formatting on a terminal is subject to change and may be 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. So if you want to see the default output without the optimizations, just do:
lscpu | less
Slay. Simple as that. โจ
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, and cores in the host system. So like, she's showing you the guest's outfit, but she'll also tell you about the host's closet. ๐ซถ
Options that produce an output table accept an optional list argument. This list is a comma-separated series of column labels to limit the table to only the specified columns, arranged in the specified order. Use --help to see a list of valid column labels. The labels are case insensitive. 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 โ it's giving "invited to the party but didn't show up." ๐
The cache sizes are reported as a summary from all CPUs. The versions before v2.34 reported per-core sizes, but this output was confusing due to complicated CPU 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 the Linux kernel and it does not always start from zero. Noted. ๐
๐ OPTIONS ๐
-a,--allโ Include lines for online and offline CPUs in the output (this is the default for-e). Heads up though: this option may only be specified together with option-eor-p. She doesn't work alone, she's a duo act. ๐ญ-B,--bytesโ Print sizes in bytes rather than in human-readable form. Raw numbers, no filter. By default, sizes are shown in units that are powers of 1024 bytes. The formal abbreviations for these units (KiB,MiB,GiB, ...) are further shortened to just their first letter:K,M,G, .... So cute, so concise. โจ-b,--onlineโ Limit the output to online CPUs (default for-p). Same rule as above: this option may only be specified together with option-eor-p. ๐ซ-C,--caches[=list]โ Display details about CPU caches. For details about available information see the--list-columnsoutput. If the list argument is omitted, all columns for which data is available are included in the command output. When specifying the list argument, the option string plus the equal sign (=) plus the list may not contain any whitespace. Examples:-C=NAME,ONE-SIZEor--caches=NAME,ONE-SIZE. The default list of columns may be extended if list is specified in the format+list(e.g.,lscpu -C=+ALLOC-POLICY). ๐-c,--offlineโ Limit the output to offline CPUs. You guessed it: this option may only be specified together with option-eor-p. ๐-e,--extended[=list]โ Display the CPU information in human-readable format. If the list argument is omitted, the default columns are included in the command output. The default output is subject to change โ do not get attached, bestie. ๐ญ When specifying the list argument, the option string plus the equal sign (=) plus the list may not contain any whitespace. Examples:-e=cpu,nodeor--extended=cpu,node. The default list of columns may be extended if list is specified in the format+list(e.g.,lscpu -e=+MHZ). ๐ฅ-H,--list-columnsโ List the columns that can be specified with the--extended,--parseand--cachesoptions. Can be used with--jsonor--rawto get the list in a machine-readable format. Machine-readable? She ate. ๐คโจ--hierarchic[=when]โ Use subsections in summary output. For backward compatibility, the default is to use subsections only when output is on a terminal, and to use flattened output on a non-terminal. The optional argument when can benever,always, orauto. If the when argument is omitted, it defaults toalways. Structure? We love structure. ๐๏ธ-J,--jsonโ Use JSON output format for the default summary or extended output (see--extended). For backward compatibility, JSON output follows the default summary behavior for non-terminals (e.g., pipes) where subsections are missing. See also--hierarchic. Curly braces, my beloved. ๐--output-allโ Output all available columns. This option must be combined with either--extended,--parse, or--caches. Give me everything, I'm nosy. ๐-p,--parse[=list]โ Optimize the command output for easy parsing. If the list argument is omitted, the command output is compatible with earlier versions oflscpu. In this compatible format, two commas are used to separate CPU cache columns. If no CPU caches are identified the cache column is omitted. If the list argument is used, cache columns are separated with a colon (:). When specifying the list argument, the option string plus the equal sign (=) plus the list may not contain any whitespace. Examples:-p=cpu,online,mhzor--parse=cpu,online,mhz. The default list of columns may be extended if list is specified in the format+list(e.g.,lscpu -p=+MHZ). Scripts, this one's for you. ๐-r,--rawโ Produce output in its raw format. This option is only applicable for the--extended,--parse, and--cachesoutputs. No seasoning, just the ingredients. ๐ง-s,--sysrootdirectory โ Gather CPU data for a Linux instance other than the instance from which thelscpucommand is issued. The specified directory is the system root of the Linux instance to be inspected. Peeking into someone else's house, respectfully. ๐-x,--hexโ Use hexadecimal masks for CPU sets (for example"ff"). The default is to print the sets in list format (for example0,1). Note that before version 2.30 the mask has been printed with0xprefix. Throwback. ๐-y,--physicalโ Display physical IDs for all columns with topology elements (core, socket, etc.). Other than logical IDs, which are assigned bylscpu, physical IDs are platform-specific values that are provided by the kernel. Physical IDs are not necessarily unique and they might not be arranged sequentially. If the kernel could not retrieve a physical ID for an element,lscpuprints the dash (-) character. The CPU logical numbers are not affected by this option. So like, she's giving you the real-world address but the mailbox numbering is chaos. ๐--arm-id[=list]โ Print a list of the known ARM core implementers and their human readable names. If an argument is given, print a list of the individual core IDs and their names, for the given implementer. ARM girlies rise. ๐--arm-modelid โ Print the name for this specific core model. This requires passing--arm-id=idto indicate the implementer id as well. Tag team, fr fr. ๐ค--annotate[=when]โ Adds an annotation to each column header name. Such an annotation can be shown as a tooltip by terminals that support this feature. The optional when argument can bealways,never, orauto. If the argument is omitted, it defaults toauto, which means that annotations will only be used when the output goes to a terminal. Little hover secrets. โจ-h,--helpโ Display help text and exit. Our savior when we forget the flags. ๐-V,--versionโ Display version and exit. ๐ซ
๐ธ ENVIRONMENT ๐ธ
LSCPU_COLUMNS=โ Specifies a comma-separated list of output columns to print. All columns listed by--list-columnsfor the options-eand-pcan be used. ๐ฑLSCPU_CACHES_COLUMNS=โ Same asLSCPU_COLUMNSwith the difference that columns only listed for the-Coption can be used. Cache-specific, iykyk. ๐LIBSMARTCOLS_DEBUG=allโ enableslibsmartcolsdebug output. ๐LIBSMARTCOLS_DEBUG_PADDING=onโ use visible padding characters. Now you can see the spacing. ๐๏ธLIBSMARTCOLS_JSON=compact|linesโ Controls JSON output format when using--json. Supported values arecompactfor JSON output with minimal whitespace, andlinesfor JSON Lines format (one JSON object per line). If unset or set to any other value, pretty-printed JSON is used. Aesthetic options, love that for us. ๐
๐ง COLUMNS ๐ง
A list of valid column labels can be viewed with the --list-columns option. Go look, she's not hiding anything. ๐
โญ NOTES โญ
The default output is subject to change. So whenever possible, you should avoid using default output in your scripts. Write it down, put it on your mirror, tattoo it. ๐
๐ BUGS ๐
The basic overview of CPU models is based on heuristics, taking into account differences such as CPU model names and implementer IDs. In some (unusual) cases, CPUs may differentiate in flags or BogoMIPS, but these differences are ignored in the lscpu overview. So like, sometimes she's guessing a lil bit. ๐ซฃ
Sometimes in Xen Dom0 the kernel reports wrong data. Not her fault, blame the kernel. ๐ญ
On virtual hardware the number of cores per socket, etc. can be wrong. Virtualization lies sometimes, bestie. ๐ญ
๐ AUTHORS ๐
Cai Qian <qcai@redhat.com>, Karel Zak <kzak@redhat.com>, Heiko Carstens <heiko.carstens@de.ibm.com>, Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Legends, all of them. ๐
๐ฅ SEE ALSO ๐ฅ
chcpu(8) โ go read that one next, she's the sister. ๐ซถ
๐ REPORTING BUGS ๐
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. Tell them everything, they want the full tea. โ
๐ AVAILABILITY ๐
The lscpu command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. Go get her. ๐
and that's the whole page, bestie!! this one shipped with util-linux 2.42.4, dated 2026-09-21 โ so yeah, fresh off the press. now go run lscpu and flex your cores. mwah ๐
โจ๐
๐ฆ where this page comes from
- arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms