Home > Operation and Maintenance > Linux Operation and Maintenance > How to check the number of CPU bits in Linux

How to check the number of CPU bits in Linux

WBOY
Release: 2022-07-29 17:12:12
Original
4040 people have browsed it

How to check the number of CPU bits in Linux: 1. Use the "getconf LONG_BIT" command or the "getconf WORD_BIT" command to check. getconf itself is an ELF executable file used to obtain system information; 2. Use "cat / proc/cpuinfo" command, which can be used to view cpu information.

How to check the number of CPU bits in Linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to check the number of bits of the CPU in Linux

Check the number of bits in the Linux operating system

1. getconf LONG_BIT If it is 32, it means 32 bits

getconf itself is an ELF executable file, used to obtain system information

Usage

getconf -a can obtain all system information

For this command, remember Just use a few commonly used information acquisition methods

getconf PAGE_SIZE Check the system memory paging size

getconf LONG_BIT The easiest way to check whether Linux is 32-bit or 64-bit

The example is as follows :

[root@db ~]# getconf LONG_BIT
32
[root@db ~]# getconf WORD_BIT
32
Copy after login

2. You can also view it through cat /proc/cpuinfo

In the Linux system, the /proc directory provides many files to display the system software. hardware information. If you want to know the CPU provider and related configuration information in the system, you can view /proc/cpuinfo. For example, we want to obtain information such as the number of physical CPUs, the number of cores of each physical CPU, and whether hyper-threading is enabled.

First of all, we must understand the concepts of physical CPU, core number, and logical CPU number:

  • Physical CPU number (physical id): The number of CPUs actually inserted on the motherboard, Several of them can be counted by not repeating the physical ID.

  • CPU cores: The number of chipsets that can process data on a single CPU, such as dual-core, quad-core, etc.

  • Number of logical CPUs: Generally speaking, logical CPU = number of physical CPUs × number of cores

Logical CPU = number of physical CPUs × Number of cores per CPU * 2 # Indicates that the server's CPU supports hyper-threading technology (simply put, it allows 1 core in the processor to become 2 cores in the operating system. In this way, the execution resources available to the operating system are doubled (This greatly improves the overall performance of the system)

The file /proc/cpuinfo shows the type of processor the system is running on, including the number of CPUs present. This is an example output of cat /proc/cpuinfo for your system.

How to check the number of CPU bits in Linux

Recommended learning: Linux video tutorial

The above is the detailed content of How to check the number of CPU bits in Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template