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