Check if system is 32bit or 64bit

uname -m # display machine "hardware name"
Display the machine "hardware name" 32 or 64 bit. "x86_64" is shown on 64 bit machines "i686" is typically shown on 32 bit machines (although, you might also see "i386" or "i586" on older Linuxen). On other "unix-like" systems, other hardware names will be displayed. For example, on AIX, "uname -m" gives the "machine sequence number". For whatever reason, IBM decided that "uname -M" would give the machine type and model. (ref: ) On Sun Solaris, "uname -m" can be used to determine the chip type and "isainfo -v" will reveal if the kernel is 64 or 32 bit. (ref: ) A more reliable way to determine "64-bit ness" across different Unix type systems is to compile the following simple C program: cat <<eeooff > bits.c /* * program bits.c * purpose Display "32" or "64" according to machine type * written January 2013 * reference */ /* hmm, curious that angle-brackets removed by data input processing? */ #include "/usr/include/stdio.h" long lv = 0xFFFFFFFF; main ( ) { printf("%2d\n",(lv < 0)?32:64); } eeooff Compile and run thusly: cc -o bits bits.c; ./bits
Sample Output
$ uname -m   # on 64 bit

$ uname -m   # on 32 bit

By: mpb
2013-01-04 11:46:43

11 Alternatives + Submit Alt

What do you think?


You must be signed in to comment.


Share Your Commands

Stay in the loop…

Follow the Tweets.



Subscribe to the feeds.


Subscribe to the feed for: