如何查看安装的linux操作系统是多少位的?32位还是64位?
如何确定linux操作系统是32位还是64位的?
只要只用以下几个命令即可实现。
5种查看linux操作系统是多少位的方法:
#1. uname -a 通过查看i386还是x86_64即可确认 #32位 [fukun@localhost ~]$ uname -a Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux #64位 [fukun @~]$uname -a Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux #2.使用更简单的 uname -i ,更直接的看到结果 #32位 [fukun@localhost ~]$ uname -i i386 #64位 [fukun @~]$uname -i x86_64 #3.通过 getconf LONG_BIT #32位 [fukun@localhost ~]$ getconf LONG_BIT 32 #64位 [fukun @~]$getconf LONG_BIT 64 #4.通过echo $HOSTTYPE来查看 #32位 [fukun@localhost ~]$ echo $HOSTTYPE i686 #64位 [fukun @~]$echo $HOSTTYPE x86_64 #5.通过 file /sbin/init 来确认 #32位 [fukun@localhost ~]$ file /sbin/init /sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped #64位 [fukun @~]$file /sbin/init /sbin/init: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped #ps.使用 getconf WORD_BIT不可行,在32位或64位下,获得的值都为32.
$HOSTTYPE
Definition: $HOSTTYPE: Automatically set to a string that uniquely describes the type of machine on which bash is executing. The default is system-dependent.
$HOSTTYPE 自动的设置为一个字符串类型,用于描述PC运行的是哪类bash。默认值为 system-dependent(系统相关)。











