1827877 Members
1409 Online
109969 Solutions
New Discussion

32 or 64 bit Linux

 
SOLVED
Go to solution
Waqar Razi
Regular Advisor

32 or 64 bit Linux

How can we know if the RHEL is 32 bits or 64 bit?
11 REPLIES 11
Mel Burslan
Honored Contributor
Solution

Re: 32 or 64 bit Linux

$ uname -a
Linux test15 2.6.9-55.EL #1 Fri Apr 20 16:25:34 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux

The x86_64 says kernel is running on x86 series cpu, with 64 bit wide kernel.
________________________________
UNIX because I majored in cryptology...
Ivan Ferreira
Honored Contributor

Re: 32 or 64 bit Linux

You can use:

getconf LONG_BIT
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Waqar Razi
Regular Advisor

Re: 32 or 64 bit Linux

uname -a
Linux APPLE 2.6.18-128.el5PAE #1 SMP Wed Dec 17 12:02:33 EST 2008 i686 i686 i386 GNU/Linux

It means it is 32 bit version?
Mel Burslan
Honored Contributor

Re: 32 or 64 bit Linux

Yup, it is 32 bit wide kernel. Also try Ivan's method to make sure it is. I never remember it when needed. Hence I resort to uname -a for the quick and dirty result display
________________________________
UNIX because I majored in cryptology...
Hakki Aydin Ucar
Honored Contributor

Re: 32 or 64 bit Linux

>Ivan:

when I issue the command in my customer's HP-UX server I am surprised:

getconf LONG_BIT
32

is it valid for HP-UX ?
Matti_Kurkela
Honored Contributor

Re: 32 or 64 bit Linux

Yes, getconf is included in POSIX standards, so it's available in many unix systems.

MK
MK
Dennis Handly
Acclaimed Contributor

Re: 32 or 64 bit Linux

>Hakki: when I issue the command in my customer's HP-UX server I am surprised: getconf LONG_BIT => 32
>is it valid for HP-UX?

It depends. Since all recent HP-UX servers only come in the color black, 64 bit, it is a waste of time checking. And the correct query is: KERNEL_BITS

Since HP-UX supports both ILP32 and LP64 at the same time, LONG_BIT is only valid for ILP32.
I don't know if sysconf(2) will change LONG_BIT to 64 in LP64?
Hakki Aydin Ucar
Honored Contributor

Re: 32 or 64 bit Linux

>Dennis: I tried to consolidate for HP-UX 32 or 64 bit under another Thread:

http://forums13.itrc.hp.com/service/forums/postQuestion.do?categoryId=156&forumId=1

please correct me if I am mistaken some steps, or put your comments there.
Dennis Handly
Acclaimed Contributor

Re: 32 or 64 bit Linux

>ME: I don't know if sysconf(2) will change LONG_BIT to 64 in LP64?

It only returns 32. If you want the size, you can use sizeof.

>Hakki: I tried to consolidate for HP-UX 32 or 64 bit under another Thread:

You mean:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1365991

>put your comments there.

Bill has done a good job.
Hakki Aydin Ucar
Honored Contributor

Re: 32 or 64 bit Linux

>Dennis: You mean:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1365991

Yes sorry about my typo :)

>>put your comments there.
>Bill has done a good job.

I am very agree.
Ragu_3
Trusted Contributor

Re: 32 or 64 bit Linux

'uname -a' gives you the running kernel info/details. Maybe you wanted to know whether your cpu can run x86_64 instead of x86 binaries. The easy way to check that out is 'cat /proc/cpuinfo', if the flags section shows 'lm' or 'lahf_lm', you should install the x86_64/amd64 port of GNU/Linux. This correct port install would make your kernel access real RAM beyond 4GB, making it use system resources more optimally.

Hth.
Debian GNU/Linux for the Enterprise! Ask HP ...