Operating System - HP-UX
1758616 Members
2010 Online
108874 Solutions
New Discussion юеВ

How to determine if a binary file is a 32 or 64 bits ?

 
SOLVED
Go to solution
frosh
New Member

How to determine if a binary file is a 32 or 64 bits ?

I'm not a HPUX administrator, and i would like to kown if it's possible to determine if a binary file is linked 32 or 64 bits ?

HP_UX 10.20 and HPUX 11.0

Thanks.
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: How to determine if a binary file is a 32 or 64 bits ?

Use the file command - for example:

file /stand/vmunix
/stand/vmunix: ELF-64 executable object file - PA-RISC 2.0 (LP64)


Pete


Pete
Umapathy S
Honored Contributor

Re: How to determine if a binary file is a 32 or 64 bits ?

Frosh,
file gives the details. Check man file for more info.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Steven E. Protter
Exalted Contributor

Re: How to determine if a binary file is a 32 or 64 bits ?

file name_of_binary_file

You can also learn a lot with the what command

what name_of_binary_file

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
frosh
New Member

Re: How to determine if a binary file is a 32 or 64 bits ?

Thanks,

but when i write to the OS prompt :
./executable_file /stand/vmunix

I've no result
frosh
New Member

Re: How to determine if a binary file is a 32 or 64 bits ?

/logi/tina/Bin/tina_backup is the pathfile of my binary file (I've a lot of binary file in this path). I can test with any of them.

Patrick Wallek
Honored Contributor

Re: How to determine if a binary file is a 32 or 64 bits ?

No, no. The command you want use is actually the command called 'file'.

# man file

# file /path/to/executable

For example:

# file memwin_stats
memwin_stats: PA-RISC1.1 shared executable dynamically linked -not stripped

The above is looking at the executable called memwin_stats. The output tells me it is 32-bit. If it shows PA-RISC1.1 or PA-RISC2.0 then it is 32-bit.

A 64-bit will show 'ELF-64' as someone above posted.
Patrick Wallek
Honored Contributor
Solution

Re: How to determine if a binary file is a 32 or 64 bits ?

In your case do:

# file /logi/tina/Bin/tina_backup

or

# file /log/tina/Bin/whatever_another_executable_is
frosh
New Member

Re: How to determine if a binary file is a 32 or 64 bits ?


#file /logi/tina/Bin/tian_backup

It works more than well!

thanks a lot.