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 --hierarchic[=when]
89 Use subsections in summary output. For backward compatibility, the
90 default is to use subsections only when output on a terminal and
91 flattened output on a non-terminal. The optional argument when can
92 be never, always or auto. If the when argument is omitted, it
93 defaults to "always".
94
95 -e, --extended[=list]
96 Display the CPU information in human-readable format.
97
98 If the list argument is omitted, the default columns are included
99 in the command output. The default output is subject to change.
100
101 When specifying the list argument, the string of option, equal sign
102 (=), and list must not contain any blanks or other whitespace.
103 Examples: '-e=cpu,node' or '--extended=cpu,node'.
104
105 The default list of columns may be extended if list is specified in
106 the format +list (e.g., lscpu -e=+MHZ).
107
108 -J, --json
109 Use JSON output format for the default summary or extended output
110 (see --extended). For backward compatibility, JSON output follows
111 the default summary behavior for non-terminals (e.g., pipes) where
112 subsections are missing. See also --hierarchic.
113
114 -p, --parse[=list]
115 Optimize the command output for easy parsing.
116
117 If the list argument is omitted, the command output is compatible
118 with earlier versions of lscpu. In this compatible format, two
119 commas are used to separate CPU cache columns. If no CPU caches are
120 identified the cache column is omitted. If the list argument is
121 used, cache columns are separated with a colon (:).
122
123 When specifying the list argument, the string of option, equal sign
124 (=), and list must not contain any blanks or other whitespace.
125 Examples: '-p=cpu,node' or '--parse=cpu,node'.
126
127 The default list of columns may be extended if list is specified in
128 the format +list (e.g., lscpu -p=+MHZ).
129
130 -s, --sysroot directory
131 Gather CPU data for a Linux instance other than the instance from
132 which the lscpu command is issued. The specified directory is the
133 system root of the Linux instance to be inspected.
134
135 -x, --hex
136 Use hexadecimal masks for CPU sets (for example "ff"). The default
137 is to print the sets in list format (for example 0,1). Note that
138 before version 2.30 the mask has been printed with 0x prefix.
139
140 -y, --physical
141 Display physical IDs for all columns with topology elements (core,
142 socket, etc.). Other than logical IDs, which are assigned by lscpu,
143 physical IDs are platform-specific values that are provided by the
144 kernel. Physical IDs are not necessarily unique and they might not
145 be arranged sequentially. If the kernel could not retrieve a
146 physical ID for an element lscpu prints the dash (-) character.
147
148 The CPU logical numbers are not affected by this option.
149
150 --output-all
151 Output all available columns. This option must be combined with
152 either --extended, --parse or --caches.
153
155 The basic overview of CPU family, model, etc. is always based on the
156 first CPU only.
157
158 Sometimes in Xen Dom0 the kernel reports wrong data.
159
160 On virtual hardware the number of cores per socket, etc. can be wrong.
161
163 Cai Qian <qcai@redhat.com>, Karel Zak <kzak@redhat.com>, Heiko Carstens
164 <heiko.carstens@de.ibm.com>
165
167 chcpu(8)
168
170 For bug reports, use the issue tracker at
171 https://github.com/util-linux/util-linux/issues.
172
174 The lscpu command is part of the util-linux package which can be
175 downloaded from Linux Kernel Archive
176 <https://www.kernel.org/pub/linux/utils/util-linux/>.
177
178
179
180util-linux 2.39.2 2023-06-14 LSCPU(1)