In today’s world of HP-UX on Itanium, this may seem archaic, since Itanium is 64bit all the way. However, you might find yourself on a PARISC machine anyway. Since PARISC processors come in 32bit and 64bit varieties, it can be important to verify which of these the current kernel is (32bit or 64bit).
It is also important to recognize the various ways of checking for 32-bit versus 64-bit kernels, and to know the limitations of each.
One way is to use the command getconf to get the number of bits used by the currently running kernel:
$ getconf KERNEL_BITS 64
You can also get the number of bits supported by the hardware, as well as find out if the hardware supports a 32-bit as well as 64-bit mode:
$ getconf HW_CPU_SUPP_BITS 64 $ getconf HW_32_64_CAPABLE 1
Another way to find this information is to use the print_manifest command, though you need to be root to run this command:
# print_manifest | grep -i "os mode" OS mode: 64 bit
However, since the print_manifest command documents the entire system, it takes a lot longer than the getconf command does.
Another way, albeit much less reliable, is to use the command file on the standard kernel.
Here’s an example from a PARISC system (an rp7420 running 11i v3):
# file /stand/vmunix /stand/vmunix: ELF-64 executable object file - PA-RISC 2.0 (LP64)
Here’s an example from an Itanium system (an rx6600 running 11i v2):
# file /stand/vmunix /stand/vmunix: ELF-64 executable object file - IA64
This command is only useful if you are using the standard kernel; if the system booted with another kernel instead, this will not give you a valid answer.
You could, however, use the file command on whatever kernel you are using to get the right answer. However, since getconf is so easy and fast, why bother?