Check if your Linux is 32-bit or 64-bit

Check if your Linux is 32-bit or 64-bit

Please note that these methods in this article are tested on Ubuntu 13.10 platform.

0. Check the ubuntu system version: cat /etc/issue

 

1. ​​Execute the "getconf LONG_BIT" command


2. Execute the 'uname -a' command

One of the most common ways to test is to run the uname command

 Order.

For example, on my system it shows the following:

  1. $ uname -a 
  • Linux ubuntu 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 athlon i686 GNU/Linux 

The highlighted i686 (or sometimes i386) means that the operating system is 32-bit, but if it shows x86_64, it means that the operating system is 64-bit.

3. Run the 'uname -m' command

The above command has too much connotation, you can use this parameter to directly point to the heart: 'uname -m'.

For example, on my system it shows the following:

  1. $ uname -m 
  • i686 

This means that my Ubuntu Linux system is 32-bit, and if the output shows x86_64, it means that the system is 64-bit.

4. Use the file command

Even though it's purely a show of skill, it's still a way to get there. Using this method requires you to run the file command with /sbin/init as an argument.

for example:

  1. $ file /sbin/init 
  • /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xc0d86a25a7abb14cad4a65a1f7d03605bcbd41f6, stripped 

高亮的 32-bit 说明这是一个32位的操作系统,如果显示为 64-bit 则说明操作系统是64位的

5. 使用 arch 命令

另外一个可以选择的方法是使用 arch 命令,这个命令用于输出机器的硬件名称。

这里有一个示例:

  1. $ arch 
  • i686 

在这里你可以看到输出的是 i686, 这说明这是一个32位操作系统,对于64位的操作系统,输出的应该是x86_64。

6. 通过系统设置的方法

如果你使用的是 Ubuntu 12.04 或更高, 你可以很简单地在** All Settings -> Details**里查看你的系统结构。

这样你就可以看到系统类型(32-bit)在这里清晰地显示出来。



Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326770625&siteId=291194637