Home  >  Article  >  Operation and Maintenance  >  How to check the number of bits of the system in centos

How to check the number of bits of the system in centos

青灯夜游
青灯夜游Original
2022-03-03 18:20:035947browse

View method: 1. Use the "getconf LONG_BIT" command; 2. Use the "getconf WORD_BIT" command; 3. Use the "file /bin/ls" command. If "32-bit" appears in the output information, then It is 32-bit, if "64-bit" appears, it is 64-bit.

How to check the number of bits of the system in centos

#The operating environment of this tutorial: centos7 system, thinkpad t480 computer.

How to check how many bits the system is in centos (32-bit or 64-bit)

Int type in 32-bit system and long types are generally 4 bytes. In 64-bit systems, the int type is still 4 bytes, but long has become 8 bytes.

In Linux systems, "getconf WORD_BIT" and "getconf LONG_BIT" can be used to obtain the number of digits of word and long.

You should get 32 ​​and 64 respectively on 64-bit systems.

getconf LONG_BIT

[root@localhost ~]# getconf LONG_BIT
64

getconf WORD_BIT

[root@localhost ~]# getconf WORD_BIT
32

file /bin/ls

[root@localhost ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

You can seeELF 64-bit LSB So the system is 64-bit

Recommended: "centos usage tutorial"

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

Statement:
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