如何查看LINUX系统是32bit还是64bit

Linux: Find If Processor (CPU) is 64 bit / 32 bit [long mode ~ lm]

by NIXCRAFT on APRIL 30, 2006 · 63 COMMENTS· LAST UPDATED OCTOBER 5, 2014

in CENTOSDEBIAN / UBUNTUHARDWARE

Iam a new Linux system user. How do I determine if my CPU is 64bit or not on a Linux operating systems using command line option? How can I check Linux kernel is in 32 bit or 64 bit mode?

You need to use the following commands to find out information about Linux kernel and CPU architecture:

  1. Tutorial details  
    Difficulty Easy (rss)
    Root privileges Yes
    Requirements Linux
    Estimated completion time 2m

  2. getconf LONG_BIT command: This command check if the OS (kernel) is 32 bit or 64 bit.
  3. uname command: This command prints system information including kernel version and whether kernel (os) is 32 bit or 64 bit.
  4. /proc/cpuinfo file: Use this file to determine if CPU is 64 bit or 32 bit i.e. find out CPU architecture.

Example - Find out if running Linux kernel (OS) is 32 or 64 bit

Type the following command at the terminal:
$ uname -a
Sample output:

Linux ora100 2.6.5-7.252-smp #1 SMP Tue Feb 14 11:11:04 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux

x86_64 GNU/Linux indicates that you've a 64bit Linux kernel running. If you use see i386/i486/i586/i686 it is a 32 bit kernel. You can also use the following command to find out if Linux kernel is running in 32bit or 64bit mode:
$ getconf LONG_BIT
Sample outputs:

64

How do I find out CPU is 32bit or 64bit on a Linux system?

Simply type the following grep command and if you see lm in output, you have a 64 bit CPU based system:
$ grep flags /proc/cpuinfo
OR
$ grep -o -w 'lm' /proc/cpuinfo | sort -u
Output:

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm

(Scroll to see all flags)

More about CPU modes:

  • lm flag means Long mode cpu - 64 bit CPU
  • Real mode 16 bit CPU
  • Protected Mode is 32-bit CPU
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值