13

In order to determine whether or not I have a 64bit OS installed, I have tried the following commands. The output of the commands do not tell me immediately if its a 32bit or 64bit OS.

After looking it up, I know armv7 is a 32 bit architecture. But is there a command that can give an immediate response?

$ uname -m
armv7l
$ uname -a
Linux raspberrypi 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux
$ arch
armv7l
$ dpkg --print-architecture
armhf
Human
  • 293
  • 1
  • 2
  • 10

3 Answers3

18

I believe you can check what bit size Linux kernel is using for LONG type with the following command:

pi@raspberrypi:~ $ getconf LONG_BIT
32

And it might give insight about your OS version :)

vaha
  • 1,240
  • 2
  • 11
  • 20
4

Second word contains 32-bit:

$ file /lib/systemd/systemd
/lib/systemd/systemd: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=59bb62c73a2fa1a741b6f22657fac8d6a0ce049f, stripped
Human
  • 293
  • 1
  • 2
  • 10
  • 2
    That is not reliable method you can run a dual system with both versions of binaries to be run the 32/64 bit hybrid system idea. Though it can be good way to test for the hybrid running. –  Mar 04 '21 at 19:07
  • This method is particularly useful when we have multiple micro sd-cards (or other media) installed with raspbian and wish to figure out what is installed on each one of them. – AjayKumarBasuthkar Apr 30 '23 at 05:59
2

Enter the command "inxi -f" That should work on most Linux systems. You can also enter "man inxi" for more information. This will only work if the man pages are installed. You can enter "man man" for more information on this command.

Gil
  • 1,228
  • 4
  • 5