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 num‐
16 ber 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 In virtualized environments, the CPU architecture information displayed
21 reflects the configuration of the guest operating system which is typi‐
22 cally different from the physical (host) system. On architectures that
23 support retrieving physical topology information, lscpu also displays
24 the number of physical sockets, chips, cores in the host system.
25
26 Options that result in an output table have a list argument. Use this
27 argument to customize the command output. Specify a comma-separated
28 list of column labels to limit the output table to only the specified
29 columns, arranged in the specified order. See COLUMNS for a list of
30 valid column labels. The column labels are not case sensitive.
31
32 Not all columns are supported on all architectures. If an unsupported
33 column is specified, lscpu prints the column but does not provide any
34 data for it.
35
36 The default output formatting on terminal maybe optimized for better
37 readability. The output for non-terminals (e.g. pipes) is never
38 affected by this optimization and it is always in "Field: data\n" for‐
39 mat.
40
41 COLUMNS
42 Note that topology elements (core, socket, etc.) use a sequential
43 unique ID starting from zero, but CPU logical numbers follow the kernel
44 where there is no guarantee of sequential numbering.
45
46 CPU The logical CPU number of a CPU as used by the Linux kernel.
47
48 CORE The logical core number. A core can contain several CPUs.
49
50 SOCKET The logical socket number. A socket can contain several cores.
51
52 BOOK The logical book number. A book can contain several sockets.
53
54 DRAWER The logical drawer number. A drawer can contain several books.
55
56 NODE The logical NUMA node number. A node can contain several draw‐
57 ers.
58
59 CACHE Information about how caches are shared between CPUs.
60
61 ADDRESS
62 The physical address of a CPU.
63
64 ONLINE Indicator that shows whether the Linux instance currently makes
65 use of the CPU.
66
67 CONFIGURED
68 Indicator that shows if the hypervisor has allocated the CPU to
69 the virtual hardware on which the Linux instance runs. CPUs
70 that are configured can be set online by the Linux instance.
71 This column contains data only if your hardware system and
72 hypervisor support dynamic CPU resource allocation.
73
74 POLARIZATION
75 This column contains data for Linux instances that run on vir‐
76 tual hardware with a hypervisor that can switch the CPU dis‐
77 patching mode (polarization). The polarization can be:
78
79 horizontal The workload is spread across all available CPUs.
80
81 vertical The workload is concentrated on few CPUs.
82
83 For vertical polarization, the column also shows the degree of
84 concentration, high, medium, or low. This column contains data
85 only if your hardware system and hypervisor support CPU polar‐
86 ization.
87
88 MAXMHZ Maximum megahertz value for the CPU. Useful when lscpu is used
89 as hardware inventory information gathering tool. Notice that
90 the megahertz value is dynamic, and driven by CPU governor
91 depending on current resource need.
92
93 MINMHZ Minimum megahertz value for the CPU.
94
96 -a, --all
97 Include lines for online and offline CPUs in the output (default
98 for -e). This option may only be specified together with option
99 -e or -p.
100
101 -B, --bytes
102 Print the sizes in bytes rather than in a human-readable format.
103
104 -b, --online
105 Limit the output to online CPUs (default for -p). This option
106 may only be specified together with option -e or -p.
107
108 -C, --caches[=list]
109 Display details about CPU caches. For details about available
110 information see --help output.
111
112 If the list argument is omitted, all columns for which data is
113 available are included in the command output.
114
115 When specifying the list argument, the string of option, equal
116 sign (=), and list must not contain any blanks or other white‐
117 space. Examples: '-C=NAME,ONE-SIZE' or '--caches=NAME,ONE-
118 SIZE'.
119
120 -c, --offline
121 Limit the output to offline CPUs. This option may only be spec‐
122 ified together with option -e or -p.
123
124 -e, --extended[=list]
125 Display the CPU information in human-readable format.
126
127 If the list argument is omitted, all columns for which data is
128 available are included in the command output.
129
130 When specifying the list argument, the string of option, equal
131 sign (=), and list must not contain any blanks or other white‐
132 space. Examples: '-e=cpu,node' or '--extended=cpu,node'.
133
134 -h, --help
135 Display help text and exit.
136
137 -J, --json
138 Use JSON output format for the default summary or extended out‐
139 put (see --extended).
140
141 -p, --parse[=list]
142 Optimize the command output for easy parsing.
143
144 If the list argument is omitted, the command output is compati‐
145 ble with earlier versions of lscpu. In this compatible format,
146 two commas are used to separate CPU cache columns. If no CPU
147 caches are identified the cache column is omitted.
148 If the list argument is used, cache columns are separated with a
149 colon (:).
150
151 When specifying the list argument, the string of option, equal
152 sign (=), and list must not contain any blanks or other white‐
153 space. Examples: '-p=cpu,node' or '--parse=cpu,node'.
154
155 -s, --sysroot directory
156 Gather CPU data for a Linux instance other than the instance
157 from which the lscpu command is issued. The specified directory
158 is the system root of the Linux instance to be inspected.
159
160 -x, --hex
161 Use hexadecimal masks for CPU sets (for example "ff"). The
162 default is to print the sets in list format (for example 0,1).
163 Note that before version 2.30 the mask has been printed with 0x
164 prefix.
165
166 -y, --physical
167 Display physical IDs for all columns with topology elements
168 (core, socket, etc.). Other than logical IDs, which are
169 assigned by lscpu, physical IDs are platform-specific values
170 that are provided by the kernel. Physical IDs are not necessar‐
171 ily unique and they might not be arranged sequentially. If the
172 kernel could not retrieve a physical ID for an element lscpu
173 prints the dash (-) character.
174
175 The CPU logical numbers are not affected by this option.
176
177 -V, --version
178 Display version information and exit.
179
180 --output-all
181 Output all available columns. This option must be combined with
182 either --extended, --parse or --caches.
183
185 The basic overview of CPU family, model, etc. is always based on the
186 first CPU only.
187
188 Sometimes in Xen Dom0 the kernel reports wrong data.
189
190 On virtual hardware the number of cores per socket, etc. can be wrong.
191
193 Cai Qian <qcai@redhat.com>
194 Karel Zak <kzak@redhat.com>
195 Heiko Carstens <heiko.carstens@de.ibm.com>
196
198 chcpu(8)
199
201 The lscpu command is part of the util-linux package and is available
202 from https://www.kernel.org/pub/linux/utils/util-linux/.
203
204
205
206util-linux March 2019 LSCPU(1)