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