lscpu
display information on CPU architecture
Synopsis
lscpu
[-hpx] [-s directory]
add an example, a script, a trick and tips
examples
source
echo "CPU
Specification,"
lscpu | sed s/":"/','/1 | tr -d ' '
}
echo -en "Getting system
details..."
getconfig > pci.csv
echo "Done."
ls -l pci.csv
source
echo "CPU
Specification,"
lscpu | sed s/":"/','/1 | tr -d ' '
}
echo -en "Getting system
details..."
getconfig > pci.csv
source
sudo lsblk > lsblk.log
sudo lscpu > lscpu.log
sudo lshw > lshw.log
sudo lspci > lspci.log
sudo lsscsi > lsscsi.log
sudo lsusb > lsusb.log
source
numa=$(lscpu | grep -i numa | cut -d ":" -f 2 | sed 's/
//g')
if [[ $numa == [0-9]* ]] && [ $numa -gt 0 ]; then
source
CPUS=`lscpu -p | grep -cv '^#'`
if [ "$CPUS" = '' ]; then CPUS=1; fi
cppcheck ../../source/ -i ../../source/win32_deps -i
../../source/configurator -j $CPUS
--enable=all --force --verbose 2>
$OUTFILE
description
lscpu
gathers CPU architecture information like number of CPUs,
threads, cores, sockets, NUMA nodes, information about CPU
caches, CPU family, model, bogoMIPS, byte order and stepping
from sysfs and /proc/cpuinfo, and prints it in a
human-readable format. It supports both online and offline
CPUs. It can also print out in a parsable format, including
how different caches are shared by different CPUs, which can
be fed to other programs.
options
-h,
--help
Print a help message.
-p,
--parse [=list]
Print out in parsable instead
of human-readable format.
If the
list argument is not given then the default
backwardly compatible output is printed. The backwardly
compatible format uses two commas to separate CPU cache
columns. If no CPU caches are identified, then the cache
columns are not printed at all.
The list
argument is comma delimited list of the columns. Currently
supported are CPU, Core, Node, Socket, Book and Cache
columns. If the list argument is given then always
all requested columns are printed in the defined order. The
Cache columns are separated by ’:’.
Note that the
optional list argument cannot be separated from the
option by a space, the correct form is for example
’-p=cpu,node’ or
’--parse=cpu,node’.
-s,
--sysroot directory
Use the specified
directory as system root. This allows you to inspect
a snapshot from a different system.
-x,
--hex
Use hexadecimal masks for CPU
sets (e.g. 0x3). The default is to print the sets in list
format (e.g. 0,1).
availability
The lscpu command is part of the util-linux package and is
available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
bugs
The basic
overview about CPU family, model, etc. is always based on
the first CPU only.
Sometimes in
Xen Dom0 the kernel reports wrong data.
author
Cai Qian
<qcai[:at:]redhat[:dot:]com>
Karel Zak <kzak[:at:]redhat[:dot:]com>