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: 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.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
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
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.
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!