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