Check for the bit version of OS


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Check for the bit version of OS
# 1  
Old 06-09-2009
Check for the bit version of OS

Hi ,

Is there a command that i can use to check the bit version of the OS.

I have a script that i need to run on all the unix flavors so how do i check for the condition

say something like this

if( 32 bit)
{

execute this

}

else

{

execute this

}

Thanks,
Praveen
# 2  
Old 06-09-2009
In Solaris, from the command line run this command:
/usr/bin/isainfo -kv
If your OS is 64-bit, you will see output like:
64-bit sparcv9 kernel modules
If your OS is 32-bit, you will get this output:
32-bit sparc kernel modules


For Linux users
If you are running Linux, you can check your distribution with the uname command:
uname -m
The output will read x86_64 for 64-bit and i686 or similar for 32-bit.
# 3  
Old 06-09-2009
Quote:
uname -a

will tell you everything about the OS including 32/64 bit
# 4  
Old 06-09-2009
The POSIX way of getting that information is to use the getconf utility. The relevant configuration variables are:
Code:
_POSIX_V6_ILP32_OFF32
_POSIX_V6_ILP32_OFFBIG
_POSIX_V6_LP64_OFF64
_POSIX_V6_LPBIG_OFFBIG

_POSIX_V7_ILP32_OFF32
_POSIX_V7_ILP32_OFFBIG
_POSIX_V7_LP64_OFF64
_POSIX_V7_LPBIG_OFFBIG

See the sysconf() man page for further information about these variables.
# 5  
Old 06-09-2009
In HP-UX 11.11.

Code:
getconf KERNEL_BITS
getconf HW_CPU_SUPP_BITS

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies

2. Red Hat

How to check the software is 32 bit or 64 bit?

How to check the installed OHS 10.1.3.3 web server is 32 bit or 64 bit on OLE 5.4 (64 bit) OS (7 Replies)
Discussion started by: nuthakki
7 Replies

3. Shell Programming and Scripting

suitable perl version for windows 2008 64 bit

Hi , While executing perl scripts , sometimes cpu consumption is going to 100% and perl script is asking to abort. In perl script , iam having some powershell commnands. out of 10 times , 9 times script runs fine and 1 time its throwing the above error. Iam using windows 2008 64 bit... (2 Replies)
Discussion started by: penchal_boddu
2 Replies

4. Linux

Request: Compile Earlier Version of XTIDE and upload XTTPD binary on 64 bit Linux

Can someone try to compile this older version of xtide (attached) on 64-bit Intel/Linux and upload the xttpd binary? I have a friend who needs an older version up and running because the newer version does not support his required harmonic files. Thanks! (7 Replies)
Discussion started by: Neo
7 Replies

5. AIX

porting an application on 64-bit AIX version 5

Hi all, I am facing problem in porting to 64 bit AIX especially with compiling options to compile and run under 64 bit kernel.Can any one put some light on the issue thanks in advance vishal (14 Replies)
Discussion started by: vishalzone2002
14 Replies

6. Solaris

How to check version of Solaris?

Hi All, Looks a foolish question, but please can someone tell me the command to check version of Solaris OS? Thanks, Am (5 Replies)
Discussion started by: am_yadav
5 Replies

7. Solaris

Check version of Oracle

Hi All, Please advice me how i can check the Oracle version on my UNIX Solaris machine without logging in to oracle? Thanks, Am (1 Reply)
Discussion started by: am_yadav
1 Replies

8. Solaris

Which version and Bit of Solaris OS

Hello 1) How can I find what bit of OS I am running on? 16 bit, 64 bit? 2) What is the difference in having different bits? 3) Below is the output of /etc/release/ what are all these components meaning? $ more /etc/release Solaris 10 11/06 s10x_u3wos_10 X86 $ Thank... (7 Replies)
Discussion started by: panchpan
7 Replies

9. UNIX for Dummies Questions & Answers

command to check the bit

i am using sunOS 5.8. What is the command to know the OS bit (8,32,64...) while the server is under production and is it possible to change from one bit to another?? replies appreciated raguram R (2 Replies)
Discussion started by: raguramtgr
2 Replies

10. Programming

to check version to library

how to check the version of Library version of Program & version of file. while compile pro*c program, I got error like elf error: no string table if u have any suggestion then give me urgently. (1 Reply)
Discussion started by: dilipluhar
1 Replies
Login or Register to Ask a Question