Search This Blog

Friday, November 20, 2009

how to tell in linux if your hardware is 32 bit or 64 bit ?

How to find out in  linux if my mahine is 64bit or 32bit ? 

To check the software, any one of the following commands will do
  1. uname -a 
  2. uname -m (more specific to the data you need) 
  3. arch (equivalent to 2) 
  4. file /sbin/init
  5. getconf LONG_BIT
To check the hardware, one of the following can do the trick: 
  1. cat /proc/cpuinfo
    the output is long 
    what we seek is the flags part, in which we seek for the lm flag. 
    lm=long mode 
    (long mode - https://en.wikipedia.org/wiki/Long_mode)

  2. sudo dmidecode -t processor
    the output is not too short;
    search for the characteristics; you should see "64-bit capable"

    btw, you can also use dmidecode to get  the "Version" and search the specifications on the internet

pay attention
over the years, I ran into some reports and claims on the net that neither of the commands to find out about the hardware were accurate (in some hardware cases), and that therefore, 
if you want to be 100% sure that the hardware is capable of running a 64 bit linux software, you need to run a boot cd/dvd with a 64bit linux. 
personally, i haven't encountered a case in which the dmidecode command failed me. 

No comments:

Post a Comment