1LSCPU(1) User Commands LSCPU(1)
2
3
4
6 lscpu - display information about the CPU architecture
7
9 lscpu [options]
10
12 lscpu gathers CPU architecture information from sysfs, /proc/cpuinfo
13 and any applicable architecture-specific libraries (e.g. librtas on
14 Powerpc). The command output can be optimized for parsing or for easy
15 readability by humans. The information includes, for example, the
16 number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access
17 (NUMA) nodes. There is also information about the CPU caches and cache
18 sharing, family, model, bogoMIPS, byte order, and stepping.
19
20 The default output formatting on terminal is subject to change and
21 maybe optimized for better readability. The output for non-terminals
22 (e.g., pipes) is never affected by this optimization and it is always
23 in "Field: data\n" format. Use for example "lscpu | less" to see the
24 default output without optimizations.
25
26 In virtualized environments, the CPU architecture information displayed
27 reflects the configuration of the guest operating system which is
28 typically different from the physical (host) system. On architectures
29 that support retrieving physical topology information, lscpu also
30 displays the number of physical sockets, chips, cores in the host
31 system.
32
33 Options that result in an output table have a list argument. Use this
34 argument to customize the command output. Specify a comma-separated
35 list of column labels to limit the output table to only the specified
36 columns, arranged in the specified order. See COLUMNS for a list of
37 valid column labels. The column labels are not case sensitive.
38
39 Not all columns are supported on all architectures. If an unsupported
40 column is specified, lscpu prints the column but does not provide any
41 data for it.
42
43 The cache sizes are reported as summary from all CPUs. The versions
44 before v2.34 reported per-core sizes, but this output was confusing due
45 to complicated CPUs topology and the way how caches are shared between
46 CPUs. For more details about caches see --cache. Since version v2.37
47 lscpu follows cache IDs as provided by Linux kernel and it does not
48 always start from zero.
49
51 -a, --all
52 Include lines for online and offline CPUs in the output (default
53 for -e). This option may only be specified together with option -e
54 or -p.
55
56 -B, --bytes
57 Print the sizes in bytes rather than in a human-readable format.
58
59 By default, the unit, sizes are expressed in, is byte, and unit
60 prefixes are in power of 2^10 (1024). Abbreviations of symbols are
61 exhibited truncated in order to reach a better readability, by
62 exhibiting alone the first letter of them; examples: "1 KiB" and "1
63 MiB" are respectively exhibited as "1 K" and "1 M", then omitting
64 on purpose the mention "iB", which is part of these abbreviations.
65
66 -b, --online
67 Limit the output to online CPUs (default for -p). This option may
68 only be specified together with option -e or -p.
69
70 -C, --caches[=list]
71 Display details about CPU caches. For details about available
72 information see --help output.
73
74 If the list argument is omitted, all columns for which data is
75 available are included in the command output.
76
77 When specifying the list argument, the string of option, equal sign
78 (=), and list must not contain any blanks or other whitespace.
79 Examples: -C=NAME,ONE-SIZE or --caches=NAME,ONE-SIZE.
80
81 The default list of columns may be extended if list is specified in
82 the format +list (e.g., lscpu -C=+ALLOC-POLICY).
83
84 -c, --offline
85 Limit the output to offline CPUs. This option may only be specified
86 together with option -e or -p.
87
88 -e, --extended[=list]
89 Display the CPU information in human-readable format.
90
91 If the list argument is omitted, the default columns are included
92 in the command output. The default output is subject to change.
93
94 When specifying the list argument, the string of option, equal sign
95 (=), and list must not contain any blanks or other whitespace.
96 Examples: '-e=cpu,node' or '--extended=cpu,node'.
97
98 The default list of columns may be extended if list is specified in
99 the format +list (e.g., lscpu -e=+MHZ).
100
101 -J, --json
102 Use JSON output format for the default summary or extended output
103 (see --extended).
104
105 -p, --parse[=list]
106 Optimize the command output for easy parsing.
107
108 If the list argument is omitted, the command output is compatible
109 with earlier versions of lscpu. In this compatible format, two
110 commas are used to separate CPU cache columns. If no CPU caches are
111 identified the cache column is omitted. If the list argument is
112 used, cache columns are separated with a colon (:).
113
114 When specifying the list argument, the string of option, equal sign
115 (=), and list must not contain any blanks or other whitespace.
116 Examples: '-p=cpu,node' or '--parse=cpu,node'.
117
118 The default list of columns may be extended if list is specified in
119 the format +list (e.g., lscpu -p=+MHZ).
120
121 -s, --sysroot directory
122 Gather CPU data for a Linux instance other than the instance from
123 which the lscpu command is issued. The specified directory is the
124 system root of the Linux instance to be inspected.
125
126 -x, --hex
127 Use hexadecimal masks for CPU sets (for example "ff"). The default
128 is to print the sets in list format (for example 0,1). Note that
129 before version 2.30 the mask has been printed with 0x prefix.
130
131 -y, --physical
132 Display physical IDs for all columns with topology elements (core,
133 socket, etc.). Other than logical IDs, which are assigned by lscpu,
134 physical IDs are platform-specific values that are provided by the
135 kernel. Physical IDs are not necessarily unique and they might not
136 be arranged sequentially. If the kernel could not retrieve a
137 physical ID for an element lscpu prints the dash (-) character.
138
139 The CPU logical numbers are not affected by this option.
140
141 --output-all
142 Output all available columns. This option must be combined with
143 either --extended, --parse or --caches.
144
146 The basic overview of CPU family, model, etc. is always based on the
147 first CPU only.
148
149 Sometimes in Xen Dom0 the kernel reports wrong data.
150
151 On virtual hardware the number of cores per socket, etc. can be wrong.
152
154 Cai Qian <qcai@redhat.com>, Karel Zak <kzak@redhat.com>, Heiko Carstens
155 <heiko.carstens@de.ibm.com>
156
158 chcpu(8)
159
161 For bug reports, use the issue tracker at
162 https://github.com/util-linux/util-linux/issues.
163
165 The lscpu command is part of the util-linux package which can be
166 downloaded from Linux Kernel Archive
167 <https://www.kernel.org/pub/linux/utils/util-linux/>.
168
169
170
171util-linux 2.38.1 2022-08-04 LSCPU(1)