Operating System - HP-UX
1850819 Members
2740 Online
104056 Solutions
New Discussion

how to find out 32bit or 64bit binaries

 
SOLVED
Go to solution
Vimala L
Occasional Advisor

how to find out 32bit or 64bit binaries


Hello there.

I wish to find out whether an executable is 64bit or 32bit. Can you please help me with the unix commands to find that?

Thank you,
Vimala.
6 REPLIES 6
U.SivaKumar_2
Honored Contributor
Solution

Re: how to find out 32bit or 64bit binaries

Hi,
#file /bin/binary
will tell you the details.
regards,
U.SivaKumar
Innovations are made when conventions are broken
H.Merijn Brand (procura
Honored Contributor

Re: how to find out 32bit or 64bit binaries

https://www.beepz.com/personal/merijn/#FAQ

Also tels you about the C compilers and the kernel version/architecture
Enjoy, Have FUN! H.Merijn
Victor_5
Trusted Contributor

Re: how to find out 32bit or 64bit binaries

getconf KERNEL_BITS

Man getconf for more.
Stefan Farrelly
Honored Contributor

Re: how to find out 32bit or 64bit binaries


cd
file * | grep executable | grep ELF-64

Will show 64 bit binaries. Anything else is only 32 bit (eg. PA-RISC1.1 or PA-RISC2.0)
Im from Palmerston North, New Zealand, but somehow ended up in London...
Cheryl Griffin
Honored Contributor

Re: how to find out 32bit or 64bit binaries

SivaKumar is correct, use file.

It may/may not obvious in many cases. However the following can be used:
PA-RISC1.1 shared executable dynamically linked = 32 bit
ELF-64 shared object file - PA-RISC 2.0 (LP64) = 64 bit

In most cases if it does not explicitly state 64 bit, it's probably not. Another way to see a bit about how it was compiled is to use chatr. Look for references to 64 bit libaries.
# chatr /usr/bin/login
shared library list:
dynamic /usr/lib/libpam.1
dynamic /usr/lib/libsec.2
dynamic /usr/lib/libnsl.1
dynamic /usr/lib/libc.2

A 64 bit library might be:
/ux/libsobj_i80/libs/libc/shared_pa2_64/obj

Cheryl
"Downtime is a Crime."
Victor_5
Trusted Contributor

Re: how to find out 32bit or 64bit binaries

Sorry for my misunderstood, Vimala. I read your post very quilcly but obviously I missed something, file is correct.