How To Show Number Of CPUs On Linux Using Lscpu, Nproc, Getconf, Cat Commands

shape
shape
shape
shape
shape
shape
shape
shape

This article describes How To Show Number Of CPUs On Linux Using Lscpu, Nproc, Getconf, Cat Commands.

The central processing unit (CPU) is the unit which performs most of the processing inside a computer. To control instructions and data flow to and from other parts of the computer, the CPU relies heavily on a chipset, which is a group of microchips located on the motherboard.

lscpu gathers CPU architecture information from sysfs and /proc/cpuinfo. The command output can be optimized for parsing or for easy readability by humans. The information includes, for example, the number of CPUs, threads, cores, sockets and Non-Uniform Memory Access (NUMA) nodes. There is also information about the CPU caches and cache sharing, family, model, bogoMIPS, byte order, and stepping.

nproc prints the number of processing units available to the current process, which may be less than the number of online processors.

getconf command displays the value of a specified configuration variable on the standard output. You can specify the configuration variable using one of the forms listed in the SYNOPSIS section. If you use the first form (system_var), getconf simply displays the value of the variable system_var. If you use the second form(path_var pathname), getconf displays the value of the variable path_var for the path name given by pathname.

Procedure:
- Log in into your Linux desktop
- Open the terminal application on Linux
- For remote server run ssh user@server-name
- To get CPU information type lscpu, nproc, getconf or cat that display information about the CPU architecture of Linux including installed CPUs

Now you can find some examples in this video.

Please subscribe to support our channel.
To be aware of our new videos please subscribe our channel.

Visit our website https://sdk-it.com
Visit our youtube channel
Watch IT & Learn IT & Apply IT.

Enjoy!