查看方法:1、使用“getconf LONG_BIT”命令;2、使用“getconf WORD_BIT”命令;3、使用“file /bin/ls”命令,如果輸出信息中出現“32-bit”則為32位,如果出現“64-bit”則為64位。
本教程操作環境:centos7系統、thinkpad t480電腦。
centos怎么查看系統是多少位的(是32位或者64位)
32位的系統中int類型和long類型一般都是4字節,64位的系統中int類型還是4字節的,但是long已變成了8字節。
linux系統中可用”getconf WORD_BIT”和”getconf LONG_BIT”獲得word和long的位數。
64位系統中應該分別得到32和64。
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
可以看到 ELF 64-bit LSB
所以該系統為64位
推薦:《centos使用教程》