Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If kernel type (64/32) is no indication of what bit your distribution is, how do I know what I'm running? I'm on Ubuntu, and I just found out, to my surprise, you can use a 64 bit kernel on a 32 bit Linux distribution... so how can I tell for sure what type of software I'm running, 64 bit or 32 bit?

share|improve this question

4 Answers 4

up vote 2 down vote accepted

Just run this on the command line

getconf LONG_BIT

It will return 32 or 64

share|improve this answer
    
accepted for simplest and most concise answer –  Victor S Jul 4 '13 at 3:48

With a 32-bit kernel, you know all applications must be 32-bit. With a 64-bit kernel, there can be any mix of 32-bit and 64-bit applications and libraries. You have to check the applications you care about to see what type they are. You can use the file command to check the bitness of a library or executable.

share|improve this answer
cat /proc/version
cat /etc/issue
uname -a

in the terminal should display helpful information to clarify what you're running on any given machine.

I would say it is very rare that you would have a kernel that is set up out of sync with the software of the distro as a whole, certainly I've never come across anyone who configured it that way, so generally you can expect x86_64 to represent a 64 bit operating system and kernel pretty much whenever you encounter it.

Since you are in ubuntu, for any given bit of software you can simply run:

apt-cache policy <packagename>

and look for the telltale signs, for example my results for skype:

apt-cache policy skype
skype:
  Installed: 4.2.0.11-0ubuntu0.12.04.1
  Candidate: 4.2.0.11-0ubuntu0.12.04.1
  Version table:
 *** 4.2.0.11-0ubuntu0.12.04.1 0
        500 http://archive.canonical.com/ubuntu/ precise/partner amd64 Packages
        100 /var/lib/dpkg/status
share|improve this answer

If you can't remember any of the others, and I can't, then the following 'trick' works, just print the length of a pointer in C/C++:

#include <iostream>
using namespace std;

int main( int argc, char *argv[] ) {
    cout << sizeof( void *) << endl;
    return 0;
}

This will give '4' on 32-bit os (ie 4 bytes = 32 bits), and '8' on 64-bit os (ie 8 bytes, = 64 bits).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.